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)
 Variable Assignment

Author  Topic 

bradjerome
Starting Member

1 Post

Posted - 2008-04-07 : 18:32:17
Is it possible to set the value for several variables from one select query?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-04-07 : 18:42:59
Yes.

SELECT @var1 = 9, @var2 = 'Tara', @var3 = 12

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -