0

There's a stored procedure I'm studying. Would this be a possible call? -

exec [dbo].[prc_RPT_Respondent_Answer] '20121011', '20121017' , 18964 , "3", "30,31,32,33,34,35,36,37,38,39,130"

I'm guessing the "30,31,32,33,34,35,36,37,38,39,130" argument is handled by code like the following(which is from the referenced sproc:

BEGIN
    INSERT 
    INTO #tempClientLK_ResponseStatuses
    SELECT CONVERT(INT, val) FROM dbo.Split(@ClientResponseRange, ',')  
END
Peter DeWeese
  • 18,141
  • 8
  • 79
  • 101
Caffeinated
  • 11,982
  • 40
  • 122
  • 216

2 Answers2

1

you can with below url, it might be helps you to resolved your problem

How to split a comma-separated value to columns

Community
  • 1
  • 1
Naresh Pansuriya
  • 2,027
  • 12
  • 15
1

Yes, this should work. I already have used this approach, few times. If you are asking about how to write that table valued function dbo.Split() then you may check this link-

http://blog.logiclabz.com/sql-server/split-function-in-sql-server-to-break-comma-separated-strings-into-table.aspx

Suvendu Shekhar Giri
  • 1,364
  • 6
  • 41
  • 71