Code Snippet posted by:
Akshayblevel | Posted on: 8/6/2012 | Category:
SQL Server Codes | Views: 685 | Status:
[Member] |
Points: 40
|
Alert Moderator
DECLARE @Pos INT
DECLARE @NextPos INT
DECLARE @String VARCHAR(50)
DECLARE @Delimiter VARCHAR(50)
SET @String ='.net,funda,.com'
SET @Delimiter = ','
SET @String = @String + @Delimiter
SET @Pos = charindex(@Delimiter,@String)
WHILE (@pos <> 0)
BEGIN
SELECT substring(@String,1,@Pos - 1)
SET @String = substring(@String,@pos+1,len(@String))
SET @pos = charindex(@Delimiter,@String)
END
Found interesting? Add this to: