0

I'm studying a stored procedure with the following variable that I need to decipher, ResponseRange :

**@ResponseRange VARCHAR(64) = null,**

then later we have:

IF (@ResponseRange is not null)
BEGIN
    INSERT 
    INTO #tempLK_ResponseStatuses
    SELECT CONVERT(INT, val) FROM dbo.Split(@ResponseRange, ',')    
END

IF (@ClientResponseRange is not null)
BEGIN
    INSERT 
    INTO #tempClientLK_ResponseStatuses
    SELECT CONVERT(INT, val) FROM dbo.Split(@ClientResponseRange, ',')  
END

What is happening with the line

SELECT CONVERT(INT, val) FROM dbo.Split(....)

I believe all the above corresponds to the code from the Web-page CS file, of which here's a sample:

new ResponseGroup() {
        ID = (int) ResponseStatusGroups.Completes,
        Code = 1,
        Label = "Completes",
        ResponseCodes = null,
        ClientResponseCodes = "10,11,12,13,14,15,16,17,18,19"
    },
    new ResponseGroup() {
        ID = (int) ResponseStatusGroups.OverQuota,
        Code = 2,
        Label = "Over Quota",
        ResponseCodes = "40,41,42,43,44,45,46,47,48,49",
        ClientResponseCodes = "40,41,42,43,44,45,46,47,48,49"
Caffeinated
  • 11,982
  • 40
  • 122
  • 216
  • 1
    what's your best guess? you have a 'val', a 'convert' and an 'int'(integer)...Also, a quick search would answer your question... – Mitch Wheat Dec 15 '12 at 02:42
  • @MitchWheat - I know it's probably doing converting, a little confused at why it's splitting. is that for if we enter smth like "30, 50 ,70" ? – Caffeinated Dec 15 '12 at 02:44
  • 1
    you are asking us to to determine why a csv list of values is used.?Because that's the logic being used! – Mitch Wheat Dec 15 '12 at 02:45
  • @MitchWheat - OK i'm starting to understand it. a lot of times I just need to see my code on stackOverflow and study it in my own question . so thanks/!! – Caffeinated Dec 15 '12 at 02:47

0 Answers0