原网址:
http://www.cnblogs.com/85538649/archive/2011/09/23/2186155.html
alter procedure Proc_UpdateDatetimeCounter
@businessNum nvarchar(200),--业务号
@column nvarchar(200),--列名
@value datetime--值
as
declare @sql nvarchar(max)
set @sql = N‘update counter set ‘+quotename(@column)+‘= @value1 where businessNum = @businessNum1‘
exec sp_executesql @sql,
N‘@value1 as datetime,@businessNum1 as nvarchar(200)‘,
@value1 = @value,
@businessNum1 = @businessNum
时间: 2024-10-11 02:03:56