CREATE PROCEDURE dbo.usp_UpdateCountryUser
(@UserID int , @CountryIds varchar(1000))
AS
BEGIN
DECLARE @intPos INT, @SubStr varchar(1000)
SET @CountryIDs=REPLACE(@CountryIDs,' ','')
SET @intPos=CHARINDEX(',',@CountryIDs)
WHILE @intPos >0
BEGIN
SET @SubStr=SubString(@CountryIDs,0,@intPos)
--delete, insert, update sql statement here
SET @CountryIDs=SUBSTRING(@CountryIDs, LEN(@SubStr) + 2, LEN(@CountryIDs) - LEN(@SubStr) + 1)
SET @IntPos = CHARINDEX(',', @CountryIDs)
END
END
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment