Viewing 15 posts - 5,281 through 5,295 (of 8,731 total)
No need for a loop and no need to cross post as it only fragments the solutions.
Further answers in this thread: http://www.sqlservercentral.com/Forums/Topic1655566-392-1.aspx
January 28, 2015 at 1:23 pm
MMartin1 (1/28/2015)
Could the 'safe' plan that incurs a higher cost be helped by updating statistics?
It could, but it won't be the same as the optimal plan.
January 28, 2015 at 1:12 pm
This is one possibility:
WITH E(n) AS(
SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL
SELECT...
January 28, 2015 at 1:10 pm
I can't help you further if I only have a part of what you're doing.
January 28, 2015 at 12:29 pm
Not a fan of this function as you might get performance problems, but maybe this is what you need.
RETURN CASE WHEN @TimeInMins = 0
THEN CONVERT(VARCHAR(2), LEFT(@RemainingSeconds,...
January 28, 2015 at 11:44 am
FWIW, imex's query will generate the same plan as yours but it's simpler to write.
Phil's might be better or not, you'll need to test it before you implement it.
For questions...
January 28, 2015 at 10:58 am
This article about dynamic pivots and cross tabs could help you.
January 28, 2015 at 10:18 am
My guess (someone else might confirm it) is that the first needs to create a safe plan while the other one can create an optimized plan. The use of variables...
January 28, 2015 at 9:44 am
If you use a column in the where clause from a table joined by an outer join, your converting it to an inner join. Check the following alternative:
SELECT COUNT(a.PatientID) AS...
January 28, 2015 at 9:01 am
Sorry, my bad.
Thank you for the correction Michael and the note about not being desirable.
January 28, 2015 at 8:49 am
Technically, the compatibility level would be 90 and up, but your idea is correct.
January 27, 2015 at 3:31 pm
montserrat.deza (1/27/2015)
Luis I tested it and it worked!! thank you for your recommendation but Idid it already.
Internally, it makes no difference. Both queries should create the same execution plan.
I...
January 27, 2015 at 2:39 pm
David Burrows (1/27/2015)
e.g. One interpretation of the flawed logic is to find all combinations of VALUEA in both tables where they do not...
January 27, 2015 at 2:26 pm
Would this work for you?
SELECT
well.wellide AS Prospect,
well.wellidc AS Pad,
well.wellname AS Well,
job.idrec AS JobID,
rig.contractor + ISNULL(' '+ rig.rigno,...
January 27, 2015 at 2:19 pm
The primary key is usually the same as the clustered index but that's not a rule. They're both independent as the process to define them is different. The primary key...
January 27, 2015 at 1:39 pm
Viewing 15 posts - 5,281 through 5,295 (of 8,731 total)