Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Update columns in the cursor?
Message
 
 
À
05/06/2002 14:13:45
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00664741
Message ID:
00665083
Vues:
29
>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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform