Viewing 15 posts - 286 through 300 (of 434 total)
@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...
June 28, 2007 at 12:10 pm
Can you post a table structure and sample data?
Is there a maximum number of conditions one person could have?
June 28, 2007 at 10:10 am
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...
June 28, 2007 at 9:36 am
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)...
June 28, 2007 at 8:41 am
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
June 27, 2007 at 4:02 pm
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...
June 27, 2007 at 3:40 pm
Sounds reasonable to me. So is EXISTS sargable?
June 27, 2007 at 3:23 pm
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...
June 27, 2007 at 2:45 pm
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...
June 27, 2007 at 2:34 pm
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...
June 27, 2007 at 2:17 pm
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...
June 27, 2007 at 1:54 pm
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...
June 27, 2007 at 10:10 am
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...
June 27, 2007 at 10:05 am
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...
June 27, 2007 at 9:57 am
I put them both into analyzer together and looked at the execution plan. They each had a cost of 50% of the whole.
June 27, 2007 at 8:16 am
Viewing 15 posts - 286 through 300 (of 434 total)