标题:保存点不会用
只看楼主
lxd0980
Rank: 7Rank: 7Rank: 7
来 自:湖南长沙
等 级:黑侠
帖 子:166
专家分:505
注 册:2011-3-27
得分:0 
我在oracle 里试了下,是可以的。
2011-05-17 11:25
诸葛修勤
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:11
帖 子:549
专家分:1955
注 册:2010-10-28
得分:0 
改动了下 这样行
程序代码:
USE master
GO

CREATE TABLE ContactReason
(
    ContactReason NVARCHAR(10),
    Description NVARCHAR(40),
    CONSTRAINT pk_contactreason PRIMARY KEY (ContactReason)
);

INSERT INTO ContactReason VALUES ('yxf', 'hhhhhhh');

BEGIN TRAN;
SELECT * FROM ContactReason;
INSERT INTO ContactReason VALUES ('1001', '///////');
INSERT INTO ContactReason VALUES ('1002', '???????');
SELECT * FROM ContactReason;
SAVE TRAN savepoint_first;
DELETE ContactReason WHERE ContactReason = 'yxf';
SELECT * FROM ContactReason;
ROLLBACK TRAN savepoint_first;
SELECT * FROM ContactReason;

DROP TABLE ContactReason;
GO

 
2011-05-17 18:35
诸葛修勤
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:11
帖 子:549
专家分:1955
注 册:2010-10-28
得分:0 
看来是我开始的那条语句写错啦
2011-05-17 18:37
lxd0980
Rank: 7Rank: 7Rank: 7
来 自:湖南长沙
等 级:黑侠
帖 子:166
专家分:505
注 册:2011-3-27
得分:0 
哦,这样了,感谢分享了.
2011-05-17 21:45



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-340047-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.570215 second(s), 9 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved