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

  • SEARCH
  • Home
  • 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 255373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:55:30+00:00 2026-05-11T21:55:30+00:00

When we first started source control the developers would just edit the scripts in

  • 0

When we first started source control the developers would just edit the scripts in the database and right before the release one big script of all the changes would be made. This worked great until one of the devs accidently deleted a stored procedure and all the work was lost.

After that we put all the scripts to create the stored procedures in text files and stored them in source control. The problem here is that the developers sometimes update the stored procedure in source control or the database and forget to update the other one.

My dream is to have a system where a dev goes in and checks out a stored procedure. Then after changes are made the database is automatically updated.

Is this just a dream? What is the best way to source control SQL Server?

  • 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-11T21:55:30+00:00Added an answer on May 11, 2026 at 9:55 pm

    We have been using Visual Studio Team System Database Edition recently, and I have to say it has worked very well. All stored procedures are stored as files, and checked in and out of source control, and it has tools to generate scripts, etc.

    Also, in the past we’ve used scripts stored as text files that are checked in and out of source control. The rule was that you had to check out the file, then edit it in, for instance, Management Studio, and save it, and check it back in. At the top of every stored procedure script file it would drop the existing stored proc, and then use the CREATE statement to create a new one (gets around the CREATE/ALTER problem). We then had a tool that would run all the scripts in the right order to build a blank database from scratch, and then we used RedGate’s SQL Compare product to generate a script to bring our existing databases up to date. I admit it was tedious.

    Around the same time I worked on a system with about 10 other developers, and they implemented a rigorous database change management procedure. There were many, many applications that all depended on a set of 2 or 3 databases. Any time a database schema had to change (we’re only talking tables, columns and views here) then a document was created that explained the change, and then there was a matrix that listed the changes vs. what applications we thought it would impact. Then the document was circulated and had to be reviewed by someone responsible for each application, and they had to search through their application for anywhere it might be impacted, etc. It was a long arduous procedure, but it worked. However, stored procs were just stored as text files in source control.

    In the more distant past, with smaller projects that were more like desktop apps with a database as the datastore, every time the app started, I would:

    • Check to see if the database existed, and if not, create it
    • Check that all the tables existed, and if not, create them
    • Check that all the columns existed, and if not, add them

    Whenever I needed to change the schema, I would just add more code to the end of the startup code to modify the schema as necessary, taking care to migrate any existing data. The benefit of this was that you could just uninstall and reinstall a new version of the software, and it would automatically upgrade the existing database to the latest version. Installation, upgrades, and maintenance was a dream. That wouldn’t work for more “enterprisey” systems though.

    You can reduce some of these problems by adopting ADO.Net Entities or another similar Entity Framework, like Entity Spaces. These are object-relational mapping layers. They auto-generate classes for each entity (table) in your database, including properties for each column, etc. Then they allow you to extend those classes with custom logic. If you can get away from having your business logic in stored procedures, and put them in the Entity classes, then the benefit is that they’re strongly typed. Therefore if you change the name of a column, or delete a column and you regenerate your entity classes, then your IDE or compiler will automatically flag all the places where the code is broken. Obviously, all the entity code is naturally in source control with the rest of your source code too.

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

Sidebar

Ask A Question

Stats

  • Questions 122k
  • Answers 122k
  • 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 http://ant.apache.org/ Here is how to do C++ projects with Ant:… May 12, 2026 at 12:41 am
  • Editorial Team
    Editorial Team added an answer Fun with extension methods... var ret = john.ToXmlString() public static… May 12, 2026 at 12:41 am
  • Editorial Team
    Editorial Team added an answer A stored procedure can return many result sets, or none,… May 12, 2026 at 12:41 am

Related Questions

I'm trying to do a Data Binding in the C# code behind rather than
We have a website that deals with artists and venues and we're developing it
Web application storing images in database. In our first setup we were storing (and
Here is a problem I've struggled with ever since I first started learning object-oriented

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.