T-SQL INSERT INTO Disabling Constraints Check
i would like to temporarly(just for the t-sql statement) disable the constraints check. My statement is: insert into branchOffice( branchOfficeTypeId, labirintoClientiId, company
Solution 1:
Constraint is on the table not a single statement
Kind of ugly but
Put it in a transaction and take a tablock
begin transaction
ALTER TABLE branchOffice NOCHECK CONSTRAINT ALL
insert into branchOffice with (tablock)
-- Re-enable the constraints on a table
ALTER TABLE branchOffice WITH CHECK CHECK CONSTRAINT ALL
commit transation;
Post a Comment for "T-SQL INSERT INTO Disabling Constraints Check"