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
 General SQL Server Forums
 New to SQL Server Programming
 to pass value of a sql query in a variable

Author  Topic 

Smita86
Starting Member

5 Posts

Posted - 2009-12-31 : 04:24:44
I have to make a procedure in which I have to pass the value of a sql query into a variable.Please guide how to do.

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-12-31 : 04:26:59
select @var=some_column from some_table where ...


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2009-12-31 : 04:55:08
or if your query is complex post it and we can give more targeted advice


Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page
   

- Advertisement -