Forum Replies Created

Viewing 15 posts - 286 through 300 (of 434 total)

  • RE: Unique Field

    @t is the table variable he created to hold the data, you would insert your actual table name there.

    (SELECT T1.PersonID, MAX(T1.Added) AS Added

                FROM @t T1

                GROUP BY T1.PersonID ) D

    selects the...

  • RE: Concatenating a field from mulitple rows into one row

    Can you post a table structure and sample data?

    Is there a maximum number of conditions one person could have?

  • RE: proper JOIN syntax

    I agree with John.  Your first statement is an inner join or sometimes called an equi join and that is all it will ever be without rewriting it. 

    The second...

  • RE: Random Record Selection

    Here is what I use to pull random records.

     

    begin

    declare @maxcount int,@winner int

    declare @winnerid int

    -- get number of entries and choose a random number

    set @maxcount = (select count(*) from sometable)...

  • RE: Extacting nth and nth row + 1

    declare @lastname varchar(100),@nextlastname varchar(100)

    set @lastname = (select lastname from @raw where id = @nthrow)

    set @nextlastname = (select lastname from @raw where id = @nthrow+1)

    select @lastname,@nextlastname

  • RE: Exists Vs Not Exists . Which one is Better?

    It does not matter for the original poster's question which has been answered.  Since the question was raised I am curious to know the answer although in this case I...

  • RE: Exists Vs Not Exists . Which one is Better?

    Sounds reasonable to me. So is EXISTS sargable?

  • RE: Exists Vs Not Exists . Which one is Better?

    I see no contradiction here.  The tests we ran showed no difference and David agreed that is what the test shows.

    David believes EXISTS is sargable and that NOT EXISTS is...

  • RE: Eliminate carriage return in data

    Problem is that this is a text file and since the number of fields will be wrong for the first 2 lines of data it should be corrected at the...

  • RE: Eliminate carriage return in data

    If the filename is standardized you can use the same ActiveX script to pick up the file from the public directory, fix the issue and then use a data transformation...

  • RE: Eliminate carriage return in data

    Here is the script to repair line 1 and 2.  I use DTS to do all sorts of file manipulation including downloading,copying, and importing.

    Are you downloading via ftp? 

    ' start script...

  • RE: Eliminate carriage return in data

    If I had my druthers I would tell whoever is creating the source data to fix it but I guess that isn't an option for you.  Does your source file...

  • RE: Exists Vs Not Exists . Which one is Better?

    After my initial test I also ran some examples on both indexed and non indexed fields in a table with 1M+ rows.  I saw no difference in the time to...

  • RE: Eliminate carriage return in data

    I would use an ActiveX script as long as you know that you are only repairing the 2nd and 3rd line.

    Read line one(header) and write to new text file

    Read line...

  • RE: Exists Vs Not Exists . Which one is Better?

    I put them both into analyzer together and looked at the execution plan.  They each had a cost of 50% of the whole.

Viewing 15 posts - 286 through 300 (of 434 total)