'Copy Database Wizard' failed when source database have any database role

  • Hi,

    I have a database with a 'database role' and it have a user member. If a use the 'Copy Database Wizard' to copy my database from my SQL Server 2008 to my other SQL Server 2008 R2 server the copy task failed. If i delete the database role from my source database the

    database copy task run ok.

    Is there a bug? In this case how i can warkaround it?

    Many thanks in advance.

  • What error do you get? Can you script out the role and user and display the SQL for it?


    My blog: SQL Soldier[/url]
    SQL Server Best Practices:
    SQL Server Best Practices
    Twitter: @SQLSoldier
    My book: Pro SQL Server 2008 Mirroring[/url]
    Microsoft Certified Master: SQL Server, Data Platform MVP
    Database Engineer at BlueMountain Capital Management[/url]

  • Hi Robert,

    I get the next error in the windows event log after execute 'Copy Database Wizard':

    "Event Name: OnError

    Message: ERROR : errorCode=-1073548784 description=Executing the query "sys.sp_addrolemember @rolename = N'MyRole', @m..." failed with the following error: "The role 'MyRole' does not exist in the current database.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

    ..."

    The role script is:

    CREATE ROLE [MyRole] AUTHORIZATION [dbo]

    GO

    And the user script is:

    CREATE USER [MyUser] FOR LOGIN [MyUser] WITH DEFAULT_SCHEMA=[dbo]

    GO

    EXEC dbo.sp_addrolemember @rolename=N'MyRole', @membername=N'MyUser'

    GO

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply