Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
Would it be possible to set multiple variables with one select statement?The Norm:SET @test = SELECT * From table1What I want:SELECT @test = Field1, @test1 = Field2 From table1
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts
Posted - 2004-10-29 : 16:56:25
this works:
quote:SELECT @test = Field1, @test1 = Field2 From table1
so what are you asking?Corey
Knarf180
Starting Member
42 Posts
Posted - 2004-10-29 : 17:03:21
When I did a Print @test I didnt get any results..Ya sure it works?
is your query "select field1, field2 from table1" returning..1. any not-null (field2) data at all?2. is it returning multiple records; with null in field2 of the last record?If NO in both cases, the @test1 will hold a null.Hemanth GorijalaBI Architect / DBA...(yuhoo!!! and now, an "Yak Master")Exchange a Dollar, we still have ONE each.Exchange an Idea, we have TWO each.