文章列表
MS SQL Server存储过程批量修改用户表所有者
新建登陆帐户,设置登陆到要修改的数据库。
创建储存过程
CREATE PROCEDURE dbo.changename
@OldOwner as NVARCHAR(128),--参数原所有者
@NewOwner as NVARCHAR(128)--参数新所有者
AS
DECLARE @Name as NVARCHAR(128)
DECLARE @Owner as NVARCHAR(128)
DECLARE @OwnerName as NVARCHAR(128)
DECLARE curObject CURSOR FOR
...