0

I would like to version control the stored procedures same as an any application. After some research, I have found the following link:

Version control stored procedures

I have added a database project to my existing project and added a new stored procedure. And tried to copy the code from my existing stored procedure into the stored procedure and I see the following issue:

enter image description here

I am wondering if one of you can guide me if anything I am doing wrong or maybe tell me that I am barking up a wrong tree. There might be better ways of version controlling stored procedures.

Thanks in advance.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Abe
  • 1,879
  • 2
  • 24
  • 39
  • You should have imported your existing database instead of copying procedures over. – Crowcoder Jun 01 '17 at 09:55
  • Thank you for your comment. Wouldn't It will be huge and moreover it has been deployed so it will have lots of data on top of stored procedures. – Abe Jun 01 '17 at 10:03
  • 1
    Import won't bring in data, just schema. But if you don't intend to manage your database with the project then just put procedures in.txt or .sql files somewhere since you can source control any file. But do look into SSDT, it can be a really great way to manage your db development. – Crowcoder Jun 01 '17 at 10:09
  • [Redgate ReadyRoll](http://www.red-gate.com/products/sql-development/readyroll/entrypage/microsoft-and-readyroll) may be a solution. – Thibault Jun 01 '17 at 11:00
  • I have create a folder SQL and scripted all SQL files and added to source control. – Abe Jun 07 '17 at 08:13

1 Answers1

2

I've used Redgate's SQL Source Control for a number of years now. You simply add your DB to the source control, allowing you then to take branches and merge back to the trunk at a later date. Hope this helps.

Redgate SQL Source Cotrol

I believe they have a 28 day trial.