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)
 returning a value from a select

Author  Topic 

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-08-11 : 07:58:19
Hi,

I know this is kinda basic but please help.

I have a query that will return a single value/single column, how do I pass this value to a variable such as nvarchar?

Thanks so much.

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-08-11 : 08:06:12
declare @blah nvarchar(500)
set @blah = (select MyTableId from MyTable WHERE MyTableId=3)
select @blah = (select MyTableId from MyTable WHERE MyTableId=3)


Go with the flow & have fun! Else fight the flow :)
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-08-12 : 02:03:55
Thanks Spirit1.
Go to Top of Page
   

- Advertisement -