views:

384

answers:

1

I'm trying to deploy a Visual Studio Database Project (GDR R2) using the VSDBCMD.exe utility. I can successfully deploy when the connection string is using Integrated Security, but when I switch to using a Sql Server authentication I get the following error:

Failed to import target model MyCatalog. Detailed message The Reverse Engineer operation cannot continue because you don't have View Definition permission on the 'MyCatalog' database.

I can successfully deploy using Sql Server authentication when deploying through Visual Studio.

Here's the command I'm using to run:

vsdbcmd
  /a:deploy 
  /dsp:sql 
  /dd- 
  /cs:"Data Source=localhost;Initial Catalog=MyCatalog;User ID=MyUserId;Password=MyPassword" 
  /script:C:\MyDbScriptFile.sql
  /manifest:C:\Database.deploymanifest         
  /p:DeploymentConfigurationFile=C:\Database.sqldeployment      
  /p:SqlCommandVariablesFile=C:\Database.sqlcmdvars

All the parameters are on separate lines only for display reasons. Again, when I change the connection string to Integrated Security it works.

Running Sql Server Profiler for Visual Studio and VSDBCMD.exe only show connections only for MyUserId. Visual Studio doesn't appear to be using a different account. But the queries being made are different. I guess I shouldn't be surprised that the tools seem to behave differently.

I don't want to add specific View Definition permissions to the user until I find out why I can do it successfully through Visual Studio.

Thanks.

A: 

Grant View Definition does make it work. Visual Studio just seems to be secretly getting permissions elsewhere.

Adam Goetz