Here is an example of what I am trying to accomplish.
declare @MenuIDs varchar(max) = '1,2,3,4';
SELECT 
    tMenuMain.MenuId, 
    tMenuMain.MenuRank 
INTO #TempRankTable 
FROM tMenuMain 
WHERE tMenuMain.MenuId IN (@MenuIDs);
select * from  #TempRankTable;                      
The @MenuIDs varaible is actually a sproc parameter. (I just declared it in the example to explain) 
How do I get the select to work, since the IN command only works with comma separated values and not just a string. Other problem I am facing is that tMenuMain.MenuId is an integer column. Is it possible to do a CAST in this situation? 
 
     
     
     
    