如何在SQL Server DDL中使用事务?
我有一个登录表,所有插入都通过一个存储过程完成。 CREATE TABLE dbo.LogTable( LogRefnr int IDENTITY(1, 1) NOT NULL, LogQuery varchar(255) NOT NULL, LogTime datetime NOT NULL, logQueryDuration int NULL, LogSessionID int NULL, CONSTRAINT PK_Log PRIMARY KEY CLUSTERED (LogRefnr) ) go Create procedure DBO.LogInsert ( @Query varchar(255), @time datetime, @duration int, @SessinID int) as begin Insert into LogTable ( …