【发布时间】:2016-07-20 02:27:41
【问题描述】:
在我们的 T-SQL 数据库中,我们有一些时间戳列,每次插入或更新记录时,我们都会从记录中选择与插入或更新的键相同的时间戳。
我们想避免双重搜索:对于更新和选择,我们尝试了这样的事情:
declare @table table(id int, val timestamp not null)
declare @table2 table(val timestamp)
insert @table(id)
output inserted.val into @table2
values (1)
但它无法编译,我在意大利语中有一个错误,例如“无法显式设置时间戳列”
有什么提示吗?
【问题讨论】:
标签: sql-server tsql