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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:41:34+00:00 2026-05-27T11:41:34+00:00

I am using a VS2010 database project, and want to be able to load:

  • 0

I am using a VS2010 database project, and want to be able to load:

  • Reference data into any instance (isolated development, test, … production)

  • Test data into development and test databases only.

As I understand it, reference data is no problem, I use scripts into a post-deployment script, which will be run unconditionally.

For test data, I understand I should use a data generation plan; and that I can use a data bound generator to load data from a data source such as Access, Excel or a text file. MSDN has a walkthrough on generating test data from an Excel spreadsheet, which at first glance looks like what I need, but it uses an absolute path to reference the Excel file. Which doesn’t seem to be compatible with having the database project in source control, accessed by different users who may have their workspaces at different locations.

What is the “best practice” for loading test data in this situation? Can I use a relative path in the connection string and be sure it will always be interpreted in the same way on all developer machines?

I was expecting to find a syntax something like the |DataDirectory| substitution string that would allow a path to be specified relative to the Database Project directory.

  • 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-27T11:41:35+00:00Added an answer on May 27, 2026 at 11:41 am

    On further reading, I think a data generation plan is the wrong tool for this scenario.

    What I’m doing now is creating a post-deployment script with the test data, then making sure it is executed conditionally by using SQL command variables. Each deployment target (isolated development; UAT; PROD) can have its own SQL command variables file (.sqlcmdvars), which will control whether the script is run.

    E.g. to load test data only for the IsolatedDev database, I can use the following in a post-deployment script:

    IF '$(DatabaseName)' = 'IsolatedDev'
    BEGIN
        ... insert statements to add test data
    END
    

    and be sure the test data won’t be inadvertently loaded into a production database.

    Please feel free to chime in with experiences and best practices.

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

Sidebar

Related Questions

Using a VS2010 SP1 Data-tier application project, I created the simplest database I could:
I've just started using a VS2010 database project to manage the release of an
When trying to deploy a VS2010 database project using the VSDBCMD tool, I get
I am doing a project with VS2010 using C#. I have a local database
I am using VS2010 premium, and I have a database project in my solution.
Im using VS2010, C# 4.0, NHibernate and NUnit in a project Im working on..
how can I enable database logging in my ASP.net application? I am using VS2010
I am working on a project using VS2010, WPF, and C#. I used SQL
I am building a WPF application using C# in VS2010. I have a database
I'm using VS2010 with the MySQL .NET Connector . My project that used to

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.