例如:update table set num=num+1 where id=**
能不能直接返回num
能不能直接返回num
解决方案 »
- 求助
- 怎么让SQL SERVER每隔几天自动扫描某张表啊?是写存储过程么?抓出数据后还要通过OA发短信,OA上又是通过ORACLE发短信,我要怎么写啊?
- 一个存储过程引发的错误,急!帮忙看一下
- SQL Server跨服务器取spid
- 一个关于left join的小问题。
- 数据库中部分数据的备份
- 求教xml格式化数据导入sqlserver问题
- 如何连接远程的数据库服务器
- Access与SQL Server有那些不兼容的地方??
- sql server 如何删除重复数据只留一条
- 菜鸟请教SQL写法
- 本地计算机上的SQLSERVERAGENT 服务启动后又停止了 一些服务自动停止,如果它们没有什么可以做的,例如"性能日志和警报"
--可以
update hllbiao set id=id+1 where id=1;
--2005+ try
update table set num=num+1 where id=**
output inserted.id,inserted.num
--更新完了以后再查一遍
select num from table where id=**
SqlCommand cmd = New SqlCommand(sql, Conn);
int num=cmd.ExecuteScalar()
語法不正確,output 放在set后面改為update table
set num=num+1
output inserted.id,inserted.num
where id=1
update table set @i=num=num+1 where id=**
select @i多記錄時declare @T Table(num int)
update table set num=num+1 output inserted.num into @T where id=**
select * from @T