declare @s varchar(500)
set @s='13030,12581'
exec('select * from novel where novelid in ('+@s+')')
C#中
SqlCommand cmd=con.CreateCommand();
cmd.CommandText="exec('select * from novel where novelid in ('+@s+')')";
cmd.Parameters.Add("@s","'13030,12581'");