Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update multi row
Message
 
 
À
28/07/2007 10:26:42
Mazahir Naya
Kuwait United Co.
Kuwait, Kuwait
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
01244357
Message ID:
01244377
Vues:
21
I would strongly recomend to make backup of your data before runnung code like that.
DECLARE @Counter int
SET @Counter = 0

UPDATE [LFMTX].[dbo].[Toc]
	SET @Counter = @Counter + 1, [Name] = 'Pre-'+ CAST(@Counter AS varchar(10))
	WHERE [Name] like 'Pre-04/07/2006-4-%'
>i am new in SQL Server 2005.i want to update multi raw in SQl Server Table.
>each raw update fields with new value.i am attaching code here.
>
>declare @counter int
>set @counter = 0
>
>SELECT * FROM [LFMTX].[dbo].[Toc]
>where Name like 'Pre-04/07/2006-4-%'
>
>---Need a Help from here
>
>while @counter < TOTAL RECORD VALUE
> begin
> UPDATE [LFMTX].[dbo].[Toc]
> SET [Name] = 'Pre-'+ cast(@counter as char)
> where Name like 'Pre-04/07/2006-4-%'
> set @counter = @counter + 1
>end
>
>
>Best Regards
>Mazahir
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform