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 3661058
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:15:57+00:00 2026-05-19T01:15:57+00:00

Visual Studio database edition comes with a tool, vsdbcmd.exe, that should allow someone to

  • 0

Visual Studio database edition comes with a tool, vsdbcmd.exe, that should allow someone to deploy a .dbschema file (which is generated by the database project on build) to a database. It does this by first building the script, then executing it:

vsdbcmd.exe /a:Deploy /cs:”Data Source=(local);Integrated Security=True;Pooling=False” /dsp:Sql /dd /model:”..\Database.dbschema” /p:TargetDatabase=TargetDB /manifest:”..\Database.deploymanifest”

I would expect that it can deploy the script to a different database server without problems. However, the complete path to the actual .mdf file is encoded in the script, along with some other references to the original databse. Either there isn’t an option to control this, or I can’t find it.

Is anyone using this? How do you deploy? Should I have used a different kind of database project (I remember having the choice way back when between “Database project” and “Server project”, but I don’t know whether that matters)?

EDIT

I can override the .sqlcmdvars just fine, but this does not solve the problem. This is an extract from the generated .sql file using a command like above:

GO
:setvar DatabaseName "TargetDB"
:setvar DefaultDataPath "C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\"

So there is the “targetdb” target database gets recorded correctly. But, a few lines further:

CREATE DATABASE [$(DatabaseName)]
ON 
PRIMARY(NAME = [Original], FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Original.mdf', SIZE = 3072 KB, MAXSIZE = UNLIMITED, FILEGROWTH = 1024 KB)
LOG ON (NAME = [Original_log], FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Original_log.ldf', SIZE = 1024 KB, MAXSIZE = 2097152 MB, FILEGROWTH = 10 %)

where Original.mdf is the name of the original database (i.e. the db where we deploy during development, and that is set in the project properties of the database project). This is where the deployment fails, either because that exact path may be different on the target machine, or on my machine because that db already exists.

These values just seem hardcoded in the generated script.

  • 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-19T01:15:57+00:00Added an answer on May 19, 2026 at 1:15 am

    This can be (is) caused when doing a Database Schema Synchronization -> Database Project. (My environment is VS2010 Enterprise RTM).

    The generated ALTER DATABASE statements are generated to mirror the source database without taking any substitution values into account (it will also include initial database sizes, etc). The problem does not appear on an Initial Database Import.

    Edit the files found under…

    Schema Objects\Database Level Objects\Storage\Files

    …and fix them to contain the correct $(DefaultDataPath)$(DatabaseName).mdf/$(DefaultLogPath)$(DatabaseName)_log.ldf values — or other — as appropriate. (Now mark them as “Skip” in your Schema Compare :-P)

    With the above “correction” keeping the values external will once again work and is the preferred method of managing such properties.

    Happy coding.

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

Sidebar

Related Questions

I'm looking at adding Visual Studio Database Edition (aka. VSDE) to my version of
Is it possible to open a .mdf database file created in Visual Studio with
I'm getting ready to setup a Visual Studio Database Edition GDR R2 project with
I'm using Visual Studio Database Edition to script a number of databases. Many of
What is the function of the DBMDL file in a visual studio database project?
I'm using Visual Studio 2005 to script out a database so that I can
We're contemplating Visual Studio licensing and need to decide whether licenses for Architecture/Database/Test editions
I've created a database in Visual Studio 2008 in an App_Data folder of a
I'd like to use Visual Studio 2008 IDE for editing my local database schema
I have successfully connected to an Oracle database (10g) from C# (Visual Studio 2008)

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.