Okay, so i found a script for a sql procedure that will take paramaters and run an sql command, my only problem is that for some of the parameters, i need to pass multipul values. Procedure in question:CREATE PROCEDURE geotest @zipselect nvarchar(4000) as DECLARE @sql nvarchar(4000), @paramlist nvarchar(4000)SELECT @sql = 'SELECT o.state_abbrv, count(o.state_abbrv) as kount FROM dbo.results o WHERE 1 = 1' IF @zipselect<>'DF' SELECT @sql = @sql + ' AND o.zip in ('+'@xzipselect'+')'SELECT @sql = @sql + ' group by o.state_abbrv ORDER BY o.state_abbrv'SELECT @paramlist = '@xzipselect nvarchar(4000)'EXEC sp_executesql @sql, @paramlist, @zipselectGO'DF' stands for my default value i dont want the procedure to add this to the select if the value is set to default because it will return everything, and at that point why add a filter right?i'm trying to execute the code with: EXEC geotest @zipselect='85302'
this give me what i was looking for if i try this:EXEC geotest @zipselect='85302,85029'
i get NOTHING. what can i do? PLEASE HELP. this is the last issue i have to work though to complete my program.