复制代码 代码如下:
EXECUTE('SELECT '+ @N +' = ISNULL(['+ @I +'],0) FROM inserted')
复制代码 代码如下:
SELECT * INTO #inserted FROM INSERTED
SELeCT * INTO #deleted FROM DELETED
复制代码 代码如下:
DECLARE @F NVARCHAR(MAX) = CONVERT(NVARCHAR(MAX),@I) --@I动态字段
EXECUTE ('SELECT ['+ @F +'] FROM #deleted)
新闻热点
疑难解答