Smart Rename giving error "Failed to register database"

Refactors and formats SQL code.

Moderators: Chris Auckland, David Atkinson, Anu Deshpande, Luke Jefferson

Smart Rename giving error "Failed to register database"

Postby MKFerret » Sun Feb 11, 2007 9:22 pm

Perhaps I'm missing something simple, but the Smart Rename feature is giving me the error "Failed to register database" after I select a New name and click Next. Has anyone seen (or more importantly, fixed) this problem?

Best Regards,

Mike
MKFerret
 
Posts: 3
Joined: Wed Jan 03, 2007 10:51 pm

Old fashioned "fix"

Postby MKFerret » Sun Feb 11, 2007 9:32 pm

... I _suppose_ I should cancel the question ... shutting down SQL Management Studio (and Visual Studio) and restarting just SQL Management Studio works upon retrying. I don't know what got locked to prevent the creation of a script, but I'm back up and running now.

All the best,

Mike
MKFerret
 
Posts: 3
Joined: Wed Jan 03, 2007 10:51 pm

Postby Germo » Mon Sep 07, 2009 5:49 pm

I also get this error, but I can't resolve it by restarting SSMS.
If I am connected to one server (I am sysadmin on this server) I have no problems, if I am connected to another server, I get the error: "Failed to register database". I am db_owner on the database, but only dbcreator and public on this server.

the second server:
Microsoft SQL Server Enterprise Edition (64-bit)
Version 10.0.2723.0

What rights I need on the server?
Germo
 
Posts: 4
Joined: Mon Sep 07, 2009 5:40 pm
Location: Berlin

Postby Chris Auckland » Tue Sep 08, 2009 6:58 pm

If you are unable to have dbo or sysadmin privileges on the server, you should be able to read the necessary metadata to register the database if you:

GRANT VIEW DEFINITION TO [{username}]

I hope this helps.
Chris
Chris Auckland
 
Posts: 757
Joined: Tue Oct 24, 2006 2:12 pm
Location: Red Gate Software Ltd.

Postby Germo » Wed Sep 09, 2009 10:19 am

This does not solve the problem:
use [master]
GO
GRANT VIEW ANY DEFINITION TO [{username}]
GO

I am the db_owner on the database, so I think I have all rights I need on the database. But it seams I need some more rights on the server or in a system database for using Smart Rename. Which?
Germo
 
Posts: 4
Joined: Mon Sep 07, 2009 5:40 pm
Location: Berlin

Postby Chris Auckland » Wed Sep 09, 2009 1:32 pm

Sorry Germo, my mistake.

I just noticed you are using SQL 2008. You will also need:

GRANT VIEW SERVER STATE TO [{username}]

I've tested this myself this time, and it resolved the 'failed to register database' issue for me.
Chris
Chris Auckland
 
Posts: 757
Joined: Tue Oct 24, 2006 2:12 pm
Location: Red Gate Software Ltd.

Postby Germo » Wed Sep 09, 2009 3:32 pm

yes, this works!
Thank you
Germo
 
Posts: 4
Joined: Mon Sep 07, 2009 5:40 pm
Location: Berlin


Return to SQL Refactor 1

Who is online

Users browsing this forum: No registered users and 0 guests