sql server如何修改系统表?

1.开启外围应用配置->RemoteDacEnabled=True

或者使用代码

--开启远程使用DAC
sp_configure 'remote admin connection',1; go reconfigure with override; go

--允许修改系统表
sp_configure 'allow updates',1;
reconfigure with override;
go

2.单用户模式启动

sql服务,启动参数 -m(这是单用户模式启动)

  

3.DAC连接

SSMS登陆,先取消,再通过新建查询登陆,输入admin:实例名

  

4.更新系统表

3.1修改排序规则

Update  sys.syscolpars  Set collationid=57380

where id=123

3.2修改自增id

Update  sys.syscolpars  Set status=1,idtval=null

where id=123

5.还是不允许更新?

  那是因为操作的不是基表,可以利用 use db_name; sp_helptext 'sys.tables',查看里头的基表是什么。

转自:https://zhidao.baidu.com/question/1734635367555964987.html

原文地址:https://www.cnblogs.com/gered/p/12132057.html