程序代码:
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