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: 
That's because your `select` statement is the equivalent of:

```
SELECT u.*, p.* 
FROM tbl_Users u  
INNER JOIN tbl_Bunker b ON u.BunkerId = b.Bunker 
WHERE u.UserId IN ('555, 3695, 8787') 

```

You're basically searching to see if `UserId` is a string that literally matches `'555, 3695, 8787'`, which is not what you want.
You can't pass a string of values to the stored procedure. The most obvious answer would be to make your whole sql query string dynamic, the two links should take you through the various other alternatives that are available -

<http://www.sommarskog.se/arrays-in-sql.html>

[Parameterize an SQL IN clause](https://stackoverflow.com/questions/337704/parameterizing-a-sql-in-clause)