Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT INTO syntax
Message
 
 
To
20/10/2002 12:49:47
Ron Hodge
Sebrex Systems, Inc.
Dacula, Georgia, United States
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00713308
Message ID:
00713310
Views:
13
Yes, you can select into variables this way
SELECT @Parent_Lsonid=lsonid, 
       @Parent_Rsonid=rsonid 
  FROM Assoc WHERE ImdNum = @Up_Spid
Regarding cursors, they are in general slower than set oriented commands but it doesn't mean you've to avoid them at all costs. If you tell us what you're trying to do maybe someone can provide you with pointers or even with solution.

>I have seen an examples of SELECT INTO variables, and I've tried to do the following:
>
>DECLARE @Parent_Lsonid char(15),
> @Parent_Rsonid char(15)
>
>SELECT lsonid, rsonid into @Parent_Lsonid, @Parent_Rsonid FROM Assoc WHERE ImdNum = @Up_Spid
>
>My question: Does SQL 2000 support the SELECT INTO variables, in addition to SELECTing INTO tables? I'm working on manipulating a binary hierarchy and I'm trying to avoid using cursors, which I understand are very slow.
>
>Thanks.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform