Forum Replies Created

Viewing 15 posts - 91 through 105 (of 161 total)

  • RE: Temp Tables

    If you are using SQL Server 2000, consider using table variables in lieu of temp tables wherever possible. You should get a sizable performance improvement.

  • RE: User Function Help

    If you wish to soft code the name of the server into a param, you will have to use a dynamic sql statement.

  • RE: Cast or Convert string to DateTime???

    If the string was in the YYYYMMDD format, SQL will implicitly convert it to a date format.

    You could convert it as follows.....

    set @strDate = '01232003'

    set @strDate = right(@strDate, 4) +...

  • RE: Union 2 tables

    Can you check the distinct list of values for columns Vessel & CallID this will check that there are no names here with spaces appended to the end.

    select distinct vessel...

  • RE: String concatenation problem

    You could try this.....

    declare @useddrives varchar(20)

    set @useddrives = ''

    select distinct @useddrives = @useddrives + left(filename, 1) + ';'

    from sysfiles

    if right(@useddrives, 1) = ';'

    set @useddrives = left(@useddrives, len(@useddrives) - 1)

    select @useddrives

    I...

  • RE: Steps to alleviate high sqlservr memory uage

    In order to assess how much memory SQL Server requires you could consider running Performance Monitor with the following counters.

    SQL Server: Memory Manager: Total Server Memory

    This counter will report the...

  • RE: Authentication in a trigger

    I think it is simply a case of changing your logic.

    Try changing the OR to an AND then it should only rollback of the user is not DOMAIN\username AND not...

  • RE: Pivot Table?

    If you know the column names in your table, you could use a UNION statement in lieu of dynamic SQL.

    declare @tableA table (yr int, q1 int, q2 int, q3 int,...

  • RE: Pivot Table?

    If you know the column names in your table, you could use a UNION statement in lieu of dynamic SQL.

    declare @tableA table (yr int, q1 int, q2 int, q3 int,...

  • RE: DTS Package code is blocking itself

    I have experienced similar problems with DTS packages in the past, but have never looked into them in such detail as you appear to have done.

    One thing that I have...

  • RE: Create Table Name Dynamically

    You can use a dynamic SQL statement, but you will have to ensure that your user has rights to create tables.

    declare @sql varchar(1000)

    declare @tablename varchar(50)

    set @tablename = 'newtable'

    set...

  • RE: Concatenating Multiple Rows

    As you state cursors are not desirable, however, they are not always avoidable.

    Your example is very difficult to do in any other way than using a row-by-row operation (cursor or...

  • RE: column formatting

    The data in your field is obviously less than the number of charaters being search for in the SUBSTRING command or the field is null.

    Needs some validation in your query...

  • RE: column formatting

    Try this, I think it gives you the results you are looking for...

    declare @test-2 table (field varchar(100))

    insert into @test-2 (field)

    values ('11 A10 Axxxxxxxxxxxxxxxxxxxxxxxx')

    select replicate('...

  • RE: column formatting

    Since you are only making reference to character positions 1-9, are you sure you mean varchar(100) and not varchar(10)?

    Can you give some data examples of what you are expecting to...

Viewing 15 posts - 91 through 105 (of 161 total)