我的测试表有两栏:
id int not null
somecolumn varchar(10))
Now see my query:
USE TRY
BEGIN TRANSACTION T1
INSERT INTO Test VALUES(7, hi );
GO
INSERT INTO Test VALUES(8, hi , ABC );
GO
PRINT @@ERROR
if @@ERROR>0
ROLLBACK TRANSACTION T1
ELSE
COMMIT TRANSACTION T1
我知道,我的第二个问题是错的,因为我想进行交易以收回,但插入第一点点,然后表明这一信息:
(1 row(s) affected)
Msg 213, Level 16, State 1, Line 1
Column name or number of supplied values does not match table definition.
213