修改数据库用户名为默认
declare tb cursor local forselect 'sp_changeobjectowner''['+replace(user_name(uid),']',']]')+'].['+replace(name,']',']]')+']'',''dbo'''from sysobjectswhere xtype = 'U' and status>=0 and user_name(uid) <> 'dbo'open tbdeclare @s nvarchar(4000)fetch tb into @swhile @@fetch_status=0beginexec(@s)fetch tb into @sendclose tbdeallocate tbgo