I have the following code, the problem is that my variable list @LocationList is essentially a csv string. When I use this as part of the where LocationID in (@LocationList
declare @querytext Nvarchar(MAX)
set @querytext = 'select Locations from table where Where LocationID in (' + @LocationList + ');';
exec sp_executesql @querytext;