Viewing 15 posts - 48,061 through 48,075 (of 49,571 total)
One of the best I saw at a previous company.
SELECT ... FROM SomeTable WHERE SomeColumn = @Var and Status = 1 or status = 2
Just like that, no brackets. Even...
December 13, 2007 at 1:08 am
Megha Yadav (12/12/2007)[hr
In this case the @tempUserID is being used in the next few queries. In this case there will be not even the seemingly less response time Am...
December 12, 2007 at 6:11 am
Generally statistics are automatically updated by SQL server. The only time it's necessary to update them manually is when the auto update is disabled (which it should never be) or...
December 12, 2007 at 5:59 am
Edit: Cross-post...
SQL doesn't insert one row at a time. It inserts the entire batch at once The Where clause (with exists) executes before the insert occurs. The operations in the...
December 12, 2007 at 3:59 am
Easiest way to do that is with a numbers table. It's a very handly thing for a lot of problems. I'm creating a temp numbers table, but you can create...
December 12, 2007 at 3:49 am
Your PK is on CustID?
At the point that the exists runs, the row
01 Phil_1
is not in Table1, hence the second row twith aa 01 id si not filtered out.
The distinct...
December 12, 2007 at 3:45 am
No need to start a new thread for this problem. It will just fragment replies and waste people's time.
December 12, 2007 at 3:21 am
As an alternative to the variables, may I suggest creating the proc WITH RECOMPILE so that each execution gets the optimal plan. It will completely eliminate parameter sniffiing.
With variables, while...
December 12, 2007 at 2:40 am
Bear in mind that you'll need a work permit to work in either country.
December 12, 2007 at 2:38 am
In theory, and providing there are no temp tables involved, yes.
I know 2005 when you do an estimated plan, fetched the plan from the cache it it's there. I haven't...
December 12, 2007 at 2:20 am
Jeff Moden (12/12/2007)
December 12, 2007 at 1:55 am
Depends what you want. I doubt there's much of a performance difference, if any.
Ifyou want the number of characters in the string, except trailing spaces, use LEN. If you what...
December 12, 2007 at 1:25 am
With an appropriate index*, the first 2 can do an index seek to get the data. The third, since it has functions applied to the columns, will do at best...
December 12, 2007 at 12:34 am
Paste the call to the proc in QA and run it with the exec plan on. It should give you back the same plan as from whatever app its called...
December 12, 2007 at 12:30 am
Viewing 15 posts - 48,061 through 48,075 (of 49,571 total)