Sunday, December 21, 2014

Calling stored procedure from another stored procedure SQL Server


While migrating users in SharePoint, i need to take care of migrating user in custom DB level.
Wrote a below script to upgrade the users with new DOMAIN account name.

ALTER PROCEDURE [DB3].[dbo].[UpdateDomainUser_WithClaim]
(
@oldUser nvarchar(300),
    @newUser nvarchar(300)
    )
AS
BEGIN
....
EXEC [DB1].[dbo].UpdateDomainUser_SP1_WithClaim @oldUser ,@newUser
EXEC [DB2].[dbo].UpdateDomainUser_SP2_WithClaim @oldUser ,@newUser
END

No comments: