SQL Server 不能创建数据库,发生错误:1807 :未能获得数据库 'model' 上的排它锁。请稍后重试操作。

declare   @sql   varchar(100)   
  while   1=1   
  begin   
    
  select   top   1   @sql   =   'kill   '+cast(spid   as   varchar(3))   
  from     master..sysprocesses       
  where   spid   >   50   and   spid   <>   @@spid     
    
  if   @@rowcount   =   0   
      break   
    
  exec(@sql)   
  end   

运行后,即可创建!

转载来源:sql server 无法创建数据库,错误代码:1807

相关文章:

  • 2021-11-21
  • 2022-01-18
  • 2021-09-03
  • 2022-12-23
  • 2021-07-23
  • 2021-12-01
猜你喜欢
  • 2021-10-16
  • 2021-06-27
  • 2021-04-26
  • 2021-05-28
  • 2021-07-17
相关资源
相似解决方案