Saving entire database in Source Control

A SQL Server Management Studio add-in to source control your database in Subversion or Team Foundation Server.

Moderators: Chris Auckland, David Atkinson, sherr, PhilScrace, andy.campbell.smith

Saving entire database in Source Control

Postby mar1jxm » Wed Oct 10, 2012 8:51 pm

Hi!

Is there any way to save an entire database in Source Control?

Thank you for your help

Jacob
mar1jxm
 
Posts: 4
Joined: Wed Oct 10, 2012 5:05 pm

Postby David Atkinson » Wed Oct 10, 2012 10:51 pm

Including the data? Why would you want to do this? You can specify small static data tables to source control, but you wouldn't ordinarily source control transactional data.
David Atkinson
 
Posts: 1124
Joined: Mon Dec 05, 2005 4:54 pm
Location: Twitter: @dtabase

Postby mar1jxm » Wed Oct 10, 2012 10:58 pm

Thank you for your reply - I need just Code - procs, views, functions.etc
mar1jxm
 
Posts: 4
Joined: Wed Oct 10, 2012 5:05 pm

Postby David Atkinson » Wed Oct 10, 2012 11:03 pm

The answer is yes. Are you having problems getting this working?
David Atkinson
 
Posts: 1124
Joined: Mon Dec 05, 2005 4:54 pm
Location: Twitter: @dtabase

Postby mar1jxm » Wed Oct 10, 2012 11:27 pm

David,

I just do not know how to do it. Could you please point me to the right direction?

Thanks,

Jacob
mar1jxm
 
Posts: 4
Joined: Wed Oct 10, 2012 5:05 pm

Postby David Atkinson » Wed Oct 10, 2012 11:42 pm

All objects will be source controlled by default. You don't have to specify them.

Create an empty folder in your source control repository, and link your database to this repository. Visit the 'Commit' tab, type in a comment and click 'Commit'.

That's all there is to it!

David
David Atkinson
 
Posts: 1124
Joined: Mon Dec 05, 2005 4:54 pm
Location: Twitter: @dtabase

Postby mar1jxm » Wed Oct 10, 2012 11:52 pm

Yes, I did that, but history did not show anything.
I guess I will see it only if I make a modification? right?
mar1jxm
 
Posts: 4
Joined: Wed Oct 10, 2012 5:05 pm

Postby David Atkinson » Wed Oct 10, 2012 11:56 pm

You should see it in the history after you did the first commit. At the very least you should see a folder structure which has a subfolder for each object type that exists (Tables, Stored Procedures, Views etc).

Are you sure you're looking at the right place in the source control client? How are you viewing the history? Does the history in SQL Source Control show you anything? (right click in the Object Explorer and select Show History)

David
David Atkinson
 
Posts: 1124
Joined: Mon Dec 05, 2005 4:54 pm
Location: Twitter: @dtabase


Return to SQL Source Control 3

Who is online

Users browsing this forum: No registered users and 0 guests