diff --git a/dialects/mssql/mssql.go b/dialects/mssql/mssql.go index c3c81aa2..7541b222 100644 --- a/dialects/mssql/mssql.go +++ b/dialects/mssql/mssql.go @@ -11,14 +11,7 @@ import ( "github.com/jinzhu/gorm" ) -func setIdentityInsert(scope *gorm.Scope) { - if scope.Dialect().GetName() == "mssql" { - scope.NewDB().Exec(fmt.Sprintf("SET IDENTITY_INSERT %v ON", scope.TableName())) - } -} - func init() { - gorm.DefaultCallback.Create().After("gorm:begin_transaction").Register("mssql:set_identity_insert", setIdentityInsert) gorm.RegisterDialect("mssql", &mssql{}) }