熱點推薦:
您现在的位置: 電腦知識網 >> 操作系統 >> Windows優化 >> 正文

如何把用戶定義的數據類型的ower改為dbo

2013-11-12 16:46:05  來源: Windows優化 

  方法先刪除再重新建立
  if exists (select * from dbosystypes where name = Ndt_ac_area)
  exec sp_droptype Nssn
  GO
  setuser 默認是DBO
  GO
  EXEC sp_addtypeNdt_ac_area Nchar () Nnot null
  GO
  
  方法直接通過數據庫全部山刪除SRX的 User Defined Data Types:
  USE master
  go
  EXEC sp_configure allow updates
  go
  RECONFIGURE WITH OVERRIDE
  go
  use t database name
  go
  begin transaction
  delete systypes where uid=user_id(srx)
  if @@rowcount<>
  commit transaction
  else
  rollback transaction
  go
  use master
  go
  EXEC sp_configure allow updates
  go
  RECONFIGURE WITH OVERRIDE
  go
  
  還忘記一點如果你不想刪除你可以用第二種方法直接更新為DBO
  
  USE master
  go
  EXEC sp_configure allow updates
  go
  RECONFIGURE WITH OVERRIDE
  go
  use t database name
  go
  begin transaction
  UPDATE systypes SET UID= where uid=user_id(srx) 直接更新
  if @@rowcount<>
  commit transaction
  else
  rollback transaction
  go
  use master
  go
  EXEC sp_configure allow updates
  go
  RECONFIGURE WITH OVERRIDE
  go
  
  
  

From:http://tw.wingwit.com/Article/os/youhua/201311/10842.html
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.