Viewing 15 posts - 7,321 through 7,335 (of 7,608 total)
In general, I too prefer NOT EXISTS, although SQL will often generate identical plans for either one.
It's definitely strongly preferred whenever possible to have an index to support the lookup,...
July 9, 2012 at 4:37 pm
I think this gets you pretty close, w/o having to resort to CLR:
WHERE
--one +/- optional, but must be first if used
PATINDEX('%[+-]%', varcharValue)...
July 9, 2012 at 4:21 pm
SQL Server explicitly discards SET values at the end of the stored proc and, AFAIK, there is absolutely no way to change that directly.
You could, of course, save the desired...
July 9, 2012 at 3:36 pm
Please substitute your db name below,
and your table name in BOTH places below where <your_table_name> appears, then run the queries and post the results.
USE <your_db_name>
SELECT
GETDATE()...
July 9, 2012 at 3:14 pm
You likely should have (at least) column A as the clustered index on the table.
Would need more details and info to determine if another column(s) should be in the clus...
July 9, 2012 at 2:54 pm
SQLKnowItAll (7/9/2012)
ScottPletcher (7/9/2012)
SQLKnowItAll (7/9/2012)
ScottPletcher (7/9/2012)
I know why the date was left out of the Sales table -- it can be derived.
What am I missing... How can it...
July 9, 2012 at 2:39 pm
SQLKnowItAll (7/9/2012)
ScottPletcher (7/9/2012)
I know why the date was left out of the Sales table -- it can be derived.
What am I missing... How can it be derived?
Join...
July 9, 2012 at 2:17 pm
Gullimeel (7/9/2012)
Just a small thing.Why do you have a fill factor of 80 for increasing identity field?Shouldnt it be 100%?
I agree that the fillfactor should be carefully reviewed, but not...
July 9, 2012 at 2:14 pm
OmegaZero (7/6/2012)
I'm not 100% sure of how to handle the AccountSales table though - since if I did it by id the dates would not match up correctly if joined...
July 9, 2012 at 2:07 pm
Dev (7/9/2012)
ScottPletcher (7/9/2012)
Dev (7/9/2012)‘select only a very small % of the total rows’ is applicable to Clustered Index as well for seek operation else it will scan the cluster.
False, of...
July 9, 2012 at 10:29 am
Dev (7/9/2012)‘select only a very small % of the total rows’ is applicable to Clustered Index as well for seek operation else it will scan the cluster.
False, of course. ...
July 9, 2012 at 10:04 am
Dev (7/8/2012)
July 9, 2012 at 9:20 am
I suggest avoiding "WEEK" or anything that could or does rely on SQL settings such as @@DATEFIRST (I don't think WEEK actually does, but I think it does always use...
July 6, 2012 at 1:09 pm
case
when degree1id = "@Degree" then (select d.Name from AcademicExperienceTypes d where p.Degree1id=d.Id)
when degree2id = @Degree then (select d.Name from AcademicExperienceTypes d where p.Degree2id=d.Id)
when degree3id = @Degree then (select...
July 6, 2012 at 12:34 pm
case
when degree1id = "@Degree" then (select d.Name from AcademicExperienceTypes d where p.Degree1id=d.Id)
when degree2id = @Degree then (select d.Name from AcademicExperienceTypes d where p.Degree2id=d.Id)
when degree3id = @Degree then (select...
July 6, 2012 at 12:29 pm
Viewing 15 posts - 7,321 through 7,335 (of 7,608 total)