?
Solved

SQL Server permission issue

Posted on 2011-02-16
9
Medium Priority
?
958 Views
Last Modified: 2012-05-11

Hello group,

I am trying to use the right click "Script Database As" function in Management Studio to create a script so later I can import database and its data on a different sdrver.

When I do this then I get a message as following:

Could not read metadata, possibly due to insufficient access rights. (Microsoft.SqlServer.Smo)

Any help will be appreciated.

Thanks.


0
Comment
Question by:akohan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
9 Comments
 
LVL 29

Expert Comment

by:mass2612
ID: 34912925
Hi,

Try this open SQL Server Mangt Studio > Connect to the SQL instance > Right click the instance name > select Properties > Select Permissions > Select the Username (of the user with the error) > scroll down the list of Explicit Permissions and Grant "View any definition".

Then have the user close all connection to SSMS and re-open and try again.
0
 

Author Comment

by:akohan
ID: 35030413

I will get back to you today.

Regards.
0
 
LVL 29

Expert Comment

by:mass2612
ID: 35048338
How did you get on?
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:akohan
ID: 35048880

OK. I found I was not using sa account .... but I think the main problem is that I'm doing this on 2 different machines:

machine A has db1
machine B has db2

when I get backup of db1 and want to restore it on B it complains that layout of databases are different.

Any suggestion?

Thanks.
0
 
LVL 29

Expert Comment

by:mass2612
ID: 35061785
When you say layout do you mean the physical location and database logical file names? If that's the case you just need to update your script / GUI settings when doing the restore to point to the correct names and locations on machine B
0
 

Author Comment

by:akohan
ID: 35183231



Yes different machine. I'm still getting

System.Data.SqlClient.SqlError: The backup set holds a backup of a database other than the existing 'StoreDB' database. (Microsoft.SqlServer.Smo)
0
 

Author Comment

by:akohan
ID: 35183730

OK solved it.
0
 

Accepted Solution

by:
akohan earned 0 total points
ID: 35183738


Solution is

RESTORE DATABASE MyDataBaseName FROM DISK = 'C:\MyDataBasename.bak' WITH REPLACE

0
 

Author Closing Comment

by:akohan
ID: 35221261
I tried this SQL command in a query and worked fine.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question