Posts

Showing posts with the label Red Gate

How to do SQL Source Control with TFS and WinMerge when you don't own "SQL Source Control"

I am a huge huge fan of Red Gate's SQL Source Control  and use it every day at work. On my side projects though I can't necessarily justify the $400 price tag (yet). So in the mean time, I am using the following somewhat painful process to source control my scripts against TFS. (Microsoft now has a hosted " Team Foundation Service " where you can host your code for free.) The current solution uses Visual Studio 2010, SQL Server 2008 R2 Express Management Studio, and WinMerge. Here's the process: Initial Load: In your TFS working folder, add a "DB" folder. For me this sits next to my Visual Studio Solution folder. Add the DB folder to Source Control. In SSMS, right-click on your database, choose Tasks > Generate Scripts and script out the entire database into your new DB folder. I create a file for each object. In Source Control, check all that in. You now have your database under version control, kinda. Add an additional sibling folder called DBC...

Ode to SQL Source Control

I remember one long day Not all that long ago    When versioning schema    Seemed like a dream-a And proved an elusive goal I was only able to bear Without pulling out my hair    Using video tips    On genning out scripts With the incomparable SQL Compare And yet I knew in my soul That my process still had a hole    When to my delight    On RedGate's new site They announced SQL Source Control This was a real game changer I could now be a TFS Ranger    With a folder called "\Code"    And another "\DB" All living in the same, uh, Manger Now I version my T-SQL gaily I commit all my changes daily    What once was all fragile    Is now beyond Agile And life is all smooth saily :^)