1

I am trying to compare two databases using Visual Studio 2012. However, the SQL instance where my database is being hosted is extremely locked down and my user does not have access to the VIEW DEFINITIONS permission.

I'm getting these errors in Visual Studio:

The target database schema could not be retrieved. The reverse engineering operation cannot continue because you do not have View Any Definition permission on the server '(URL here)'.

Comparing the master database requires VIEW ANY DEFINITION permission.

But yet, I can use tools like Red-Gate SQL Compare and XSQL to compare the databases. I don't want to purchase this software and I rather use Visual Studio 2012 because I already have a license... How can I overcome this problem? Is there any way I can use SQL Server Data Tools without VIEW ANY DEFINITION permission?

dimiguel
  • 1,429
  • 1
  • 16
  • 37

3 Answers3

1

You need to give db_owner permission in SQL server to user as

SQL server
Security
Logins
Specific user
User mapping
Specific database
Check db_owner
OK

Raj kumar
  • 1,275
  • 15
  • 20
1

Oddly enough, restarting my Visual Studio fixed the issue for me.

Chris Gong
  • 8,031
  • 4
  • 30
  • 51
-1

Running a comparison at the database-level rather than the instance-level did the trick.

dimiguel
  • 1,429
  • 1
  • 16
  • 37
  • 10
    what does that mean? – sensei May 12 '16 at 09:53
  • Sorry that this is two years late, but from what I remember Visual Studio 2012 allowed you to choose how far up you wanted your comparison to run at. I unfortunately had mine set for the whole instance, which meant that I was running a comparison on *every single database*. I moved my comparison downwards to run only on the specific database I was interested in and this problem was solved. – dimiguel Jun 12 '18 at 21:43