August 31, 2011 at 6:39 pm
When you're trying to update and select information at the same time, wouldn't it be simpler to use OUTPUT:
UPDATE dbo.Book
SET LastAccess = GETDATE()
OUTPUT INSERTED.Title, INSERTED.Author
WHERE BookId = @BookId
(I believe you can get similar results in Oracle with RETURNING)
September 2, 2011 at 12:25 pm
sankalpa (8/31/2011)
SmallDateTime data type also help when optimizing the datatype
Be careful with that. It's only accurate to the minute. So 23:59:30 = 0:00:00 when using smalldatetime and that can mess up date range tests unless you're careful. Date is good though if you are only storing date.
September 2, 2011 at 12:37 pm
I'm having trouble with slow Update queries, and all the performance tuning articles talk about Select queries. Any link to tuning Update queries? Or should I post my query here?
Viewing 3 posts - 16 through 18 (of 18 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy