Michele di Nuzzo

Data Science and Machine Learning

Do update the system tables in SQL Server 2008 R2. Fix “Ad hoc updates to system catalogs are not allowed”

In this version of SQL Server is not possible to make updates to the system tables:

sql_server

To do that you must perform the procedure sp_configure:

sp_configure 'allow updates',0
go
reconfigure
go

This procedure works if SQL Server is started in single server mode. To start sql server in single server must stop the SQL Server server and start it from the command prompt:

cd \
cd C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn
sqlservr.exe -m

You must then run the commands from the shell. We open a new command prompt and type:

cd \
cd C:\Program Files\Microsoft SQL Server\100\Tools\Binn
sqlcmd -Smacchina\istanza -E

When the shell opens run in sequence the commands:

sp_configure 'allow updates',0
go
reconfigure
go

At this point we can close the two prompts (the one that is running SQL Server must be terminated with CTRL + C and confirming with Y) and restart the SQL Server service. It should now be possible to make updates to the system tables.

Leave a Reply