參考來源
想要再SQL or store procedure 內傳入 In 的參數呢 ?
declare @test varchar(200);
select @test='''report.itemNumber'',''report.project''';
^^^都是單引號喔!!!
exec ('SELECT TOP 1000 [OBJECTID]
,[ATTRIBUTENAME]
,[ATTRIBUTETYPE]
,[DELETED]
,[DESCRIPTION]
,[PERMISSION]
,[REQUIREDOPTION]
FROM [track].[dbo].[TATTRIBUTE]
where ATTRIBUTENAME in (' + @test+ ')');
請問一下,若不用動態sql呢
回覆刪除不用動態,那就寫固定!
刪除select * from xxx where id in ('abc','edf')