TFS 2008

Early Access Program for SQL Source Control

Moderators: Chris Auckland, David Atkinson, sherr

TFS 2008

Postby fizz » Wed Apr 21, 2010 5:50 am

What are the options using TFS 2008 when I don't have a development copy of the DB I am trying to impose some source control on. And not likely to get one anytime soon!

I want to be able to replace any code (authorised or not) in the DB with what exists in TFS and if the version in the DB always overrules the TFS source Control version I am lost.

I have linked the production DB in question into TFS, the source control folders are populated with the stored proc's etc, all is fine there.

I have had to modify an existing Sp in prod. This was checked out, mods done and tested, changes applied to existing SP, file checked in through the Commit. All looking good.

If I want to edit it through VS however, any changes are recorded and the file is checked in but while a difference is noted, I cannot 'Get Latest ' from TFS to SSMS. I am assured there are no changes. Hence if any changes are made in the DB and not Committed, I may not be able to undo them. What have I done wrong (apart from the lack of a dev environment :roll: )

Thanks
Fizz
fizz
 
Posts: 2
Joined: Wed Apr 21, 2010 5:33 am
Location: Australia

TFS 2008 - No Dev DB

Postby sherr » Thu Apr 22, 2010 2:27 pm

Hello,

Just to note, SQL Source Control is still in an early access phase and we do not recommend using it on Production DBs.

Your situation is kind of unique since you do not have a dev db...

I don't understand exactly what you are trying to do. :-) It sounds like you are using Visual Studio and editing the CREATE script files directly. The whole purpose of SQL Source Control is that you can continue to work directly on your db within SQL Server Management Studio, so that you don't have to worry about the CREATE scripts and SQL Source Control generates them for you. If you do make a change in VS and commit it, then you should see this on the Get Latest tab and you can click the "Get Latest" button to update the db. What do you mean that you cannot "Get Latest?" Please be careful that the SQL syntax within the script is correct. This is why it is better to just work directly on the db.

It's true that changes to the db do not automatically get committed to source control. This requires discipline from the db developer to commit the change. We would like them to supply a comment when commiting so others can understand why they made the change. SQL Source Control helps by placing blue indicators on the ObjExp, which reminds you that you have made changes that you haven't commited yet.

You can use SQL Compare Pro to automatically check that your production db is at the version you expect it to be. This is retroactive, but allows you to see if any changes are made directly to prod that were not expected. These changes can then be applied back to your dev db and committed to source control if that's what is decided.

I hope this helps! Please let me know if you are still having problems getting changes from TFS to your db.

Thank you!
Stephanie M. Herr :-)
SQL Source Control - Project Manager
sherr
 
Posts: 126
Joined: Thu Mar 19, 2009 12:45 pm
Location: Cambridge

Postby fizz » Thu Apr 22, 2010 11:32 pm

Good morning

Thanks. To try to clarify what I am attempting to do:
1) I am looking to establish a source control system - not only no dev environment but no source control either.
One reason for this is to overcome the problem of senior management "modifying" code in the DB without reference to other users or security or data integrity etc. Changing their access is not an option, so enforcing some Source Control may slow them down. I would hope it gives the option of replacing the code in the DB with what is in source Control.

2) It is possible that other developers within the organisation may choose to modify some code and they may use Visual Studio for this rather than Management Studio.
I was trying to see what the results were when this occurred. I found I could check out edit save checkin/commit etc from VS but I could not "deploy" those changes to the DB. When clicking the Get Latest button to update the DB I received advice that there was nothing to Update. It appeared as though the DB was held to be the source of all truth and while I could see the differences between the 2 files I only had the option to Commit the DB version rather than get the latest version.

Does that make it any clearer?

And the good news is I might be closer to getting a dev system now!
Fizz
fizz
 
Posts: 2
Joined: Wed Apr 21, 2010 5:33 am
Location: Australia


Return to SQL Source Control EAP

Who is online

Users browsing this forum: No registered users and 0 guests