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 2000 Forums
 Transact-SQL (2000)
 Variable assignment in T-SQL

Author  Topic 

nabeel
Starting Member

15 Posts

Posted - 2002-04-12 : 19:58:13
Hi...

Is there a way to assign a variable the value from a query without using cursors? i.e. something like:

SELECT @state = state FROM orders WHERE orderNum = '1234567'

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-04-12 : 21:09:19
Yeah, the syntax you used will work just fine.

Go to Top of Page
   

- Advertisement -