Viewing 15 posts - 4,366 through 4,380 (of 7,615 total)
23:59:59.000 does not really make sense in SQL Server, since it doesn't match any system data type's time sensitivity.
Smalldatetime is 23:59 and datetime is 23:59:59.997.
March 28, 2016 at 1:04 pm
Use a tally table -- a table of just sequential numbers -- to generate the months. You can use an in-line tally table or a stored tally table. ...
March 28, 2016 at 11:53 am
Are you certain that query is the one that is deadlocking? So that query wasn't really commented out in the proc?!
Do you have on trace flags, at least 1222,...
March 24, 2016 at 9:32 am
And prefix every column in the query with a table alias. Remember, we have no idea what columns are in what tables.
Which table is "ID" in?
Which table is "NO_OF_PIN"...
March 24, 2016 at 9:19 am
mceventphoto (3/23/2016)
Where b.ITEMCODE = @itemCode
with
Where...
March 23, 2016 at 3:00 pm
Sure, you can do it, but if you post the code it's extremely likely we here can re-work the entire method being used and make it much better.
create table #values...
March 23, 2016 at 10:05 am
The year, the 3-digit number and the incrementing number should all be stored as separate columns. You then use a computed column to construct the rptnum column. That...
March 22, 2016 at 11:12 am
Excellent article! My only additional suggestion would be to put your code in the master db, and start the proc name with sp_, so that the code can easily...
March 22, 2016 at 10:35 am
Don't see anything better at a relatively quick look, although I would get rid of the double negative logic:
SELECT *
FROM #OrderDetails OD
WHERE OD.ActionCode = 'V' OR...
March 18, 2016 at 4:06 pm
Sergiy (3/17/2016)
TheSQLGuru (3/17/2016)
1) using a temp table (NOT table variable!!)Not sure if there is much of a difference here.
Scoping - yes, quite different.
Can you name anything else?
You can...
March 18, 2016 at 9:35 am
Phil Parkin (3/17/2016)
ScottPletcher (3/17/2016)
Phil Parkin (3/16/2016)
March 17, 2016 at 2:24 pm
Phil Parkin (3/16/2016)
March 17, 2016 at 2:00 pm
Jeff Moden (3/16/2016)
Sergiy (3/16/2016)
Jeff Moden (3/16/2016)
Lynn Pettis (8/6/2012)
An empty string is not null, it is a known value (empty).
I strongly agree. NULL is not NOTHING. NOTHING...
March 17, 2016 at 1:52 pm
You need to review the indexes from scratch. That is, analyze SQL's index usage stats, missing index stats and index operational stats. The longer time period you have...
March 17, 2016 at 11:56 am
Viewing 15 posts - 4,366 through 4,380 (of 7,615 total)