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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:57:16+00:00 2026-05-10T19:57:16+00:00

As far as I understand, if I want to get my database under source

  • 0

As far as I understand, if I want to get my database under source control then I need to be checking in change scripts for each change and then running them from some revision to get the correct DB.

I am trying to make a batch file that will be checked in too, that allows other developers on the team to re-build the DB locally without too much trouble. I believe sqlcmd is the way to achieve this. I have it setup to enumerate all files in the dir of .sql files and run sqlcmd for each.

My question is who has done this before and do you have an advice on the best way to achieve this? Is the way I intend to do this the best way or is there a better way?

Hope that’s not too vague.

Thanks in advance,

Martin.

  • 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. 2026-05-10T19:57:17+00:00Added an answer on May 10, 2026 at 7:57 pm

    If you are using a ORM tool like NHibernate you save yourself the trouble of having DB change scripts because the ORM can recreate the database from it’s mapping files (that are under source control).

    That’s a pretty easy way of having the appropriate db version for every revision.

    I also then recreate the whole schema whenever executing tests to make sure I have a consistent state.

    I recently blogged about that: http://www.tigraine.at/2008/10/30/sourcecontrol-and-databases-when-orm-comes-in-handy/

    I also once had a project that had Sql update scripts, and we just had a little helper tool built (very very basic) that opened the folder, sorted all scripts (we were naming them 1 – foo.sql, 2 – bar.sql) and executed them in order against the DB.

    If a developer had a new script he simply added it to the end (34 – bla bla.sql).

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

Sidebar

Ask A Question

Stats

  • Questions 147k
  • Answers 147k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer using a group by on userid against the hits_table allows… May 12, 2026 at 9:08 am
  • Editorial Team
    Editorial Team added an answer That's the correct syntax. You have more than the necessary… May 12, 2026 at 9:08 am
  • Editorial Team
    Editorial Team added an answer It's null. C# Language Specification 3.0 (Section §7.2.7: Lifted operators)… May 12, 2026 at 9:08 am

Related Questions

Let's assume I browse a specific web page that uses JavaScript to update its
I asked a question the other day regarding overlay icons. With help, I figured
How can I change the current working directory from within a Java program? Everything
I am developing an application which includes a WCF service and its ASP.NET MVC

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.