社区
MS-SQL Server
帖子详情
存储过程里可以有事务
iwillgo2
2003-12-08 03:42:58
存储过程里可以有事务吗,如何实现,希望给一个小例子说明一下问题,谢谢
...全文
114
3
打赏
收藏
存储过程里可以有事务
存储过程里可以有事务吗,如何实现,希望给一个小例子说明一下问题,谢谢
复制链接
扫一扫
分享
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
zjcxc
元老
2003-12-08
打赏
举报
回复
--示例
create proc p_test
as
begin tran
insert into 表 values(值)
if @@error=0
commit tran
else
rollback tran
go
pwzhu666
2003-12-08
打赏
举报
回复
up
txlicenhe
2003-12-08
打赏
举报
回复
eg:
create procedure test
As
begin tran
insert ...
if @@error<> 0 goto Err
delete...
if @@error<> 0 goto Err
update..
if @@error<> 0 goto Err
commit
return
Err:
rollback
hdu 5073 Galaxy(数学)
题目链接:hdu 5073 Galaxy 题目大意:给定N个点,可以移动其中的K的点,问说最后I的最小值可以是多少。 解题思路:因为质量都为1嘛,所以就是求方差,可以移动K个,所以即选连续的n=N-K个使得方差最小。注意N=K的情 况。 S表示n个数的和,T表示n个数平方的和,那么这n个数的方差即为T - S * S / n,然后扫描一遍数组维护S,T,并且计算 方差
HDU 5073 Galaxy (2014 Anshan D简单数学)
HDU 5073 Galaxy (2014 Anshan D简单数学) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5073 Description Good news for us: to release the financial pressure, the government started selling galaxies and we...
HDU 5073 Galaxy(数学公式)
题目链接: 解题思路:
hdu 5073 Galaxy (数学+推导)
hdu 5073 Galaxy (数学+推导)——black的专栏 —— waShaXiu
HDU 5073 Galaxy(数学)
思路:看了两个小时的题目...就是维护个平方和以及和,然后瞎搞一下就好了 #include using namespace std; #define LL long long const int maxn = 50005; LL s[maxn]; /*void solve(int n,int k) { double sum = 0; for(int i = 1;i<=k;i
MS-SQL Server
34,876
社区成员
254,635
社区内容
发帖
与我相关
我的任务
MS-SQL Server
MS-SQL Server相关内容讨论专区
复制链接
扫一扫
分享
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章