Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

'Copy Database Wizard' failed when source database have any database role Expand / Collapse
Author
Message
Posted Thursday, June 14, 2012 4:20 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, July 16, 2014 4:55 AM
Points: 101, Visits: 516
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.
Post #1315737
Posted Friday, June 15, 2012 7:38 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: 2 days ago @ 10:16 AM
Points: 1,612, Visits: 1,537
What error do you get? Can you script out the role and user and display the SQL for it?



My blog: SQL Soldier
Twitter: @SQLSoldier
My book: Pro SQL Server 2008 Mirroring
Microsoft Certified Master: SQL Server 2008
Principal DBA: Outerwall, Inc.
Also available for consulting: SQL DBA Master
Post #1316618
Posted Monday, June 18, 2012 12:34 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, July 16, 2014 4:55 AM
Points: 101, Visits: 516
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


Post #1317151
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse