Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Update columns in the cursor?
Message
 
 
To
05/06/2002 14:13:45
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00664741
Message ID:
00665083
Views:
27
>Thanks for your help. Yeah.. I am using SQL 2000 only. But I have a problem in using Table variable. Actually I don't know how to use table variable? So please give me an example of using table variable (If possible). I really appreciate your help.

The code below demonstrates how you can use table variable.
DECLARE @t1 TABLE (
   keyfield int, dummy varchar(100))

INSERT INTO @t1 VALUES (1, 'Some text')
INSERT INTO @t1 VALUES (2, 'Some other text')
INSERT INTO @t1 VALUES (3, 'Some other text')

UPDATE @t1 SET dummy = 'Text for ID 3' 
	WHERE keyfield = 3
SELECT * FROM @t1
See 'table data type' in BOL for details.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform