The interface is designed to be manual and cannot be used to modify thousands of servers in batches.
Because this script is executed in batches.
Environment: redgate + mssql 2008 r2
The following code is used when you modify your business.
Copy codeThe Code is as follows:
-- Allows updates to system tables.
Exec sp_configure 'Allow updates', 1
Reconfigure with override
GO
-- Unmark the ID column
Update syscolumns set colstat = 0 where id = object_id ('tablename') and colstat = 1
GO
-- Insert rows with id = 8001-8003
-- Restore the flag of an ID column
Update syscolumns set colstat = 1 where id = object_id ('tablename') and name = 'identify column name'
-- Reset the start value of the identifier
Dbcc checkident (Table Name, RESEED, 10003)
-- Update of system tables is prohibited.
Exec sp_configure 'Allow updates', 0
Reconfigure with override
There is also a lot of batch operation knowledge,
For example, check whether the index is accurate in batches.
Whether the field length is consistent
Whether the running result of the job is consistent
Whether the service is started at the same time
......
All must be processed in batches.
You can refer to other articles to obtain other batch operations.