February 16, 2005 at 10:14 pm
BOL recommends that you use 'Set @local_variable = scalar_value' instead of 'Select @local_variable = scalar_value', but it doesn't say why. Can someone tell me why 'Set' is recommended over 'Select'?
Thank you.
p.s.
I don't know why the v's were removed from the title of this thread.
February 16, 2005 at 11:45 pm
It's to do with ANSI compliance. Take a look at this article,
http://vyaskn.tripod.com/differences_between_set_and_select.htm
--------------------
Colt 45 - the original point and click interface
February 18, 2005 at 7:41 am
Also, remember that 'select' always returns a count ('x rows affected') unless you use SET NOCOUNT ON.
February 18, 2005 at 8:19 am
I don't know the answer to this, but wouldn't there be a difference that a SET would be deterministic, while select would not?
There may be implications regarding this (?)
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply