How to change the "user-defined data type" to dbo?

xiaoxiao2021-03-06  66

Method 1. Remove if EXISTS first, then re-establish if fis = n'dt_ac_area ') Exec sp_droptype n'sn' go setuser - default is DBO Go EXEC SP_ADDTYPEN 'DT_AC_AREA', N'Char ( 3) ', N'Not Null' Go

2. Delete method of User Defined Data Types SRX directly through the database of all the mountain: USE master go EXEC sp_configure 'allow updates', '1' go RECONFIGURE WITH OVERRIDE go use t --database name go begin transaction delete systypes where uid = user_id ( 'SRX') IF @@ rowcount <> 0 Commit Transaction Else Rollback Transaction Go Use Master Go EXEC SP_CONFIGURE 'Allow Updates', '1' Go Reconfigure with Override Go

I have forgotten, if you don't want to delete, you can use the second method to be updated directly to DBO:

USE master go EXEC sp_configure 'allow updates', '1' go RECONFIGURE WITH OVERRIDE go use t --database name go begin transaction UPDATE systypes SET UID = 1 where uid = user_id ( 'srx') - directly update if @@ rowcount <> 0 Commit Transaction Else Rollback Transaction GO Use Master Go Exec SP_Configure 'Allow Updates', '1' Go Reconfigure with Override Go

转载请注明原文地址:https://www.9cbs.com/read-119758.html

New Post(0)