Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7551803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:35:29+00:00 2026-05-30T10:35:29+00:00

I have a standard sql server 2008 project which has been created using vs2010.

  • 0

I have a standard sql server 2008 project which has been created using vs2010. I have been trying to modify the build process so that at the end a custom task should fire which would call VSDBCMD to generate a deploy script by comparing the output of the build (the dbschema file) against a static DBschema file. When I run this command from a VS2010 command prompt

vsdbcmd.exe /a:deploy /dd:- /dsp:sql /model:obj\Release\EnterpriseBuild.Services.Database.dbschema /targetmodelfile:VersionedSchemas\v1.0.dbschema /DeploymentScriptFile:NewDeploymentScript.sql /p:TargetDatabase="EnterpriseBuild.Database"

Everything works great and the newdeployment.sql file is generated. However when I modify my .dbproj file and include this as a AfterBuilds Target

 <Target Name="AfterBuild">
    <!--<Message Text="sample text" Importance="high"></Message>-->
    <Exec IgnoreExitCode="false"  
          WorkingDirectory="C:\Program Files (x86)\Microsoft Visual Studio 10.0\VSTSDB\Deploy\" 
          Command="vsdbcmd.exe /a:deploy /dd:- /model:obj\Release\EnterpriseBuild.Services.Database.dbschema /targetmodelfile:VersionedSchemas\v1.0.dbschema /DeploymentScriptFile:NewDeploymentScript.sql /p:TargetDatabase=&quot;EnterpriseBuild.Database&quot;" />
  </Target>

the build fails with a

EnterpriseBuild.Services.Database.dbproj(211,5): error MSB3073: The command "vsdbcmd.exe /a:deploy /dd:- /model:obj\Release\EnterpriseBuild.Services.Database.dbschema /targetmodelfile:VersionedSchemas\v1.0.dbschema /DeploymentScriptFile:NewDeploymentScript.sql /p:TargetDatabase="EnterpriseBuild.Database"" exited with code 1.

message.

Can anyone suggest what I am doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T10:35:31+00:00Added an answer on May 30, 2026 at 10:35 am

    I managed to solve it. Basically doing this

    <Target Name="AfterBuild">
        <!--<Message Text="sample text" Importance="high"></Message>-->
        <Exec IgnoreExitCode="false"  
              WorkingDirectory="C:\Program Files (x86)\Microsoft Visual Studio 10.0\VSTSDB\Deploy\" 
              Command="vsdbcmd.exe /a:deploy /dd:- /model:obj\Release\EnterpriseBuild.Services.Database.dbschema /targetmodelfile:VersionedSchemas\v1.0.dbschema /DeploymentScriptFile:NewDeploymentScript.sql /p:TargetDatabase=&quot;EnterpriseBuild.Database&quot;" />
      </Target>
    

    rightly sets the working directory to C:\Program Files(x86)….where my VersionedSchemas\v1.0.dbschema etc. don’t exist. The trick was to keep the working directory same as the ProjectDirectory and still call VSDBCMD. I managed this by doing

    <Exec IgnoreExitCode="false" Command="&quot;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VSTSDB\Deploy\vsdbcmd&quot;  /a:deploy /dd:- /model:obj\Release\EnterpriseBuild.Database.dbschema /targetmodelfile:VersionedSchemas\v1.0.dbschema /DeploymentScriptFile:NewDeploymentScript.sql /p:TargetDatabase=&quot;EnterpriseBuild.Database&quot;" />
    

    The trick was to use & quot; around C:\Pro…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a synchronous mirroring environment with automatic fail-over using sql server 2008 standard
I have an application which successfully uses SqlDependency with SQL Server 2008 Standard Edition.
I have upgraded a SQL Server Express 2005 instance to Standard using the best
Currently I have a custom tool which generates vanilla-SQL (only using standard SQL), from
Using SQL Server 2008 I created a Stored Procedure called MyStoreProc and it runs
We are using SQL Server 2008 R2 Standard and linked servers to get information
I'm trying to backup a database in SQL Server 2008 and have the database
I have installed SQL Server 2008 Standard edition and I want to upgrade it
I have a database in SQL Server 2008 R2 Standard Edition. I want to
I have been trying to compile an old project for my company, which uses

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.