Viewing 15 posts - 481 through 495 (of 1,347 total)
A sub-SELECT within a SELECT will always be a performance hit. It forces the sub-SELECT to be re-evaluated for every row in the main resultset and creates cursor-like behaviour.
Put the...
May 25, 2006 at 9:39 am
>>what i need is just UNIQUE SSN's thats all.
Then take the other columns out of the resultset.
If the same SSN has 2 or more different names, that is a data...
May 25, 2006 at 9:35 am
>>The problem is I should get unique ssn’s irrespective of first name, last name, DOB.
The problem is not what you should get. The problem...
May 25, 2006 at 9:10 am
And also please confirm that your "sample" data is "generated" data and does not reflect real person's SSNs and birth dates ...
May 25, 2006 at 8:58 am
>>Except now I can't replace the dates with "@Start" and "@End".
It would help if you expanded on "can't".
Are you getting errors ? If so, what are they ?
Or incorrect...
May 23, 2006 at 2:57 pm
The IF statement is a T-SQL control flow statement, and is not meant to be embedded within SQL statements. It looks like you're trying to build a different derived table,...
May 23, 2006 at 12:26 pm
Do you have a unique identifier (eg a Session ID) that can be used to link the event id to the set of data that has been changed as a result of...
May 23, 2006 at 11:37 am
There is nothing wrong with UNION queries. If that's the only way to retrieve the data set required, then use it.
The primary optimization concern is whether or not the data...
May 23, 2006 at 9:48 am
You can't avoid getting a time component in a smalldatetime column - it's designed to store date & time, so that's what it stores.
Declare @TestDate As Smalldatetime
Select @TestDate = '19...
May 19, 2006 at 11:38 am
>>Would you recommend setting up a job to reindex all tables once a week
Depends on the environment (volume of Insert/Update/Delete versus Select), and what your indexes look like - does...
May 19, 2006 at 8:27 am
It depends.
Making a column nullable may increase the number of rows per page, thereby reducing overall table size. Potential performance improvement.
Making a column nullable where the column is subject to...
May 16, 2006 at 2:37 pm
Since this is an import to a staging table, make the staging column a varchar type. Once the import is done, run a subsequent SQL task to convert the varchar...
May 8, 2006 at 12:04 pm
There is no FIRST() aggregate function, because the business rules defining "first" are so different. In your case, "First" means "earliest date".
In this case, you join to a derived table...
May 8, 2006 at 10:38 am
>>Select * From Master
I think an obvious performance culprit has been overlooked: "Select *"
Do you really need all columns from both tables ? If you slap a covering index on the...
May 4, 2006 at 3:36 pm
Always use unambiguous date formats if using quoted strings and expecting SQL Server to implicitly convert your quoted string to a true datetime.
'3/1/2006' - is that 3rd of January or...
March 27, 2006 at 9:41 am
Viewing 15 posts - 481 through 495 (of 1,347 total)