Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update multi row
Message
 
 
To
28/07/2007 10:26:42
Mazahir Naya
Kuwait United Co.
Kuwait, Kuwait
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
01244357
Message ID:
01244377
Views:
20
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform