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.
| Author |
Topic |
|
Dennis
Starting Member
11 Posts |
Posted - 2007-03-05 : 09:29:14
|
| What is the recommended way to set a variable in a TSQL script? and why?declare @i int;set @i = 2;orselect @i = 2;is there any difference? |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-03-05 : 09:31:05
|
the end result is same.set only allow assignment of single variable but select allow assignment of multiple variable in a single statement KH |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-03-05 : 09:31:19
|
| http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55620Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
|
cykophysh
Starting Member
24 Posts |
Posted - 2007-03-06 : 11:35:15
|
| I found an intresting article some years back which I added to my blog for future reference that might help[url]http://threenineconsulting.com/forum/blogs/cykophysh/archive/2006/12/30/Difference-between-Set-and-Select.aspx[/url] |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
cykophysh
Starting Member
24 Posts |
Posted - 2007-03-06 : 13:32:21
|
Thanks I added another disclaimer in bold just in case quote: Originally posted by X002548 I guess it's kinda bad form to cut and paste another authors text...even though you supplied a link, it could be construed that it was your work...Or you can not google, and do the leg work on your own...only to have it pointed out to youhttp://weblogs.sqlteam.com/brettk/archive/2007/02/12/60090.aspxBrett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxAdd yourself!http://www.frappr.com/sqlteam
Kind Regards,Gary<A href="http://www.threenineconsulting.com" target="_blank" >My Website</a> || <a href="http://threenineconsulting.com/forum/blogs/cykophysh/default.aspx" targer="_blank">My Blog</a> |
 |
|
|
|
|
|