Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 set @order = 5 and select @order = 5

Author  Topic 

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2009-09-02 : 16:09:53
Which one is better?
set @order = 5
select @order = 5

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-09-02 : 16:12:16
Use SET for just one item and SELECT for multiple items.

But they are practically equivalent. I know people have done performance testing on this, but the performance difference is so tiny that it doesn't matter which you use.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-09-03 : 03:10:01
http://vyaskn.tripod.com/differences_between_set_and_select.htm

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -