Convert coma separated integers

# Thread: Convert coma separated integers

1. Junior Member
Join Date
Dec 1969
Posts
21

## Convert coma separated integers

Convert coma separated integers<BR> <BR>Polly - 14 Oct - 11:30:58 AM<BR>--------------------------------------------------------------------------------<BR>Hi pals,<BR><BR>My application is a 3 tiered (ASP- COM-SQL). One of the methods passes a list of integers as coma separated values to the SP in string format. In the SP, I should convert the parameter to integer format, so that I can use like this:<BR><BR>Param1 = 123<BR>Param2 = 44<BR>Param3 = "123,234,348,457"<BR><BR>------------------------------<BR>UPDATE Table1 SET Col1=Param1,<BR>Col2=Param2<BR>WHERE ID IN<BR>( Param3 )<BR>------------------------------<BR><BR>Any light on how to do this would be helpful. Can I use "Convert" here?<BR> <BR>Thanks in advance,<BR>Polly

2. Senior Member
Join Date
Dec 1969
Posts
5,955

## Split() and CInt() should help. <eop>

.

3. Senior Member
Join Date
Dec 1969
Posts
10,852

## RE: Convert coma separated integers

Here&#039;s an article that explains it: http://sqlteam.com/item.asp?ItemID=11499

4. Junior Member
Join Date
Dec 1969
Posts
21

## RE: Convert coma separated integers

Thank you guys for your help,<BR>Everythin is workin fine now.<BR><BR>ilango;)

5. Senior Member
Join Date
Dec 1969
Posts
96,118

## Ummm...Oliver...

SPLIT and CINT don&#039;t exist in TSQL. So how do you use them in the Stored Procedure???<BR><BR>

6. Senior Member
Join Date
Dec 1969
Posts
5,955

## I thought she meant ASP when she...

...wrote ASP, so I assume she was doing this in VBScript. My fault. Ignore me next time. ;-)<BR><BR>Oliver.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•