Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to keep history of SQL Server stored procedure revisions

Note: I am not asking about full version control.

Is there any way automatically to keep a history of stored procedures on SQL Server.

Similar to how Google Docs automatically keeps a history of versions of documents and Wikipedia automatically keeps a history of versions of articles.

I don't want users updating stored procedures to have also to maintain a repository of stored procedures. This is too much work and people won't do it.

Hopefully this is something I can turn on in SQL Server...

(And by stored procedures really I mean functions, triggers, etc. Basically everything under Programmability.)

like image 356
cja Avatar asked Oct 21 '22 18:10

cja


1 Answers

You could run RedGate SQL Compare every hour to write all definitions to a disk. If the same job commits that directory to source control, you get an hourly history of the database.

You can also use RedGate SQL Source Control, but that requires everyone to commit manually.

like image 177
Andomar Avatar answered Oct 27 '22 11:10

Andomar