SQL ALTER TABLE SET (LOCK_ESCALATION = TABLE) on production server

GlorryHob

New Member
I need to create a new table which have foreign key with "Users" table.Users table has 2 millions of records.When I run script on our test server it locks this table and test users cannot query this table during transaction.Query starts like;\[code\]BEGIN TRANSACTIONGOALTER TABLE dbo.Users SET (LOCK_ESCALATION = TABLE)GOCOMMIT/*CREATE NEW TABLE AND FOREIGN KEYS HERE*/\[/code\]What would be to safe way to run on production without locking it?Should we set production server in "Maintenance Mode" and set back live again when sql transaction complete?
 
Top