CREATE PROCEDURE [dbo].[Pro_TEST] AS BEGIN DECLARE @split NVARCHAR(200) DECLARE @c NVARCHAR(200) SET @split=',' SET @c='025,023,014,015' CREATE TABLE #T (col NVARCHAR(200)) WHILE ( CHARINDEX(@split, @c) <> 0 ) BEGIN INSERT #T( col ) VALUES ( SUBSTRING(@c, 1, CHARINDEX(@split, @c) - 1) ) SET @c = STUFF(@c, 1, CHARINDEX(@split, @c), '') END INSERT #T( col ) VALUES ( @c ) SELECT * FROM #T END GO --execute Pro_TEST