Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Assign value to @local_variable
Message
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01077688
Message ID:
01077715
Views:
42
The first one can be used to assign one or more local variables in one select.

>I am not sure I understand 100% (I am getting tierd and hungry and I am out of coffee).
>Are you saying that:
>
>DECLARE @Data binary(1024)
>SELECT @Data = Data FROM myTable WHERE Id=2
>
>
>is prefered over
>
>
>DECLARE @Data binary(1024)
>SET @Data = (SELECT Data FROM myTable WHERE Id=2)
>
>?
>
>After using an Id that exists I get the desired result using both approaches. :)
>
>Now to the part I don't understand. The SELECT statement with UNION ALL was that related to this post?
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform