Question: When I try this query it works:

```
SELECT *
FROM tbl_Users
WHERE UserId IN (555, 3695, 8787))

```

But when I put it in stored procedure it get value only if I pass one ID. If I pass more ID's 

I got nothing returned from database:

```
CREATE PROCEDURE myStoredProcedure
    @m_UserIdList varchar(500)
AS    
    SELECT u.*, p.*
    FROM tbl_Users u 
    INNER JOIN tbl_Bunker b 
    ON u.BunkerId = b.Bunker
    WHERE u.UserId IN (@m_UserIdList)

```

Answer: 
Shark explained it better than I was going to. If I remember right you can do this, but it's been a long time since I had to do what you are after so I might be wrong.

```
EXEC('SELECT u.*, p.*
      FROM tbl_Users u 
      INNER JOIN tbl_Bunker b ON u.BunkerId = b.Bunker
      WHERE u.UserId IN (' + @m_UserIdList + ')')

```
Since it wasn't mentioned, you can use the XML data type.

```
BEGIN
DECLARE @xml XML
SELECT @xml = '<n>1</n><n>2</n><n>3</n>'

SELECT t.n.value('.','int')  FROM @xml.nodes('*') as t(n)
IF 1 IN (SELECT t.n.value('.','int')  FROM @xml.nodes('*') as t(n))
    PRINT('Yep')
IF 4 NOT IN (SELECT t.n.value('.','int')  FROM @xml.nodes('*') as t(n))
    PRINT('It Works')
END

```

It's not as efficient as table valued columns but it's easier to setup/use for the "Caller".

If the caller already has an array or list of elements to convert them to XML he just has to do a String.Join with "</n><n>" as the delimiter then if the resulting string is not empty prepend "<n>" and append "</n>"