方法1.先删除,再重新建立
if exists (select * from dbo.systypes where name = ndt_ac_area)
exec sp_droptype nssn
go
setuser –默认是dbo
go
exec sp_addtypendt_ac_area, nchar (3), nnot null
go
方法2.直接通过数据库全部山删除srx的 user defined data types:
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
还忘记一点,如果你不想删除,你可以用第二种方法直接更新为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) –直接更新
if @@rowcount<>0
commit transaction
else
rollback transaction
go
use master
go
exec sp_configure allow updates, 1
go
reconfigure with override
go
