Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Database Revision Control

Author  Topic 

KHeon
Posting Yak Master

135 Posts

Posted - 2004-04-13 : 16:44:26
Hello everyone!

Just wondering what -- if any -- source control mechanisms people are using for their database schemas, sprocs, views, triggers, etc.

StarTeam from Borland (aquired when they bought StarBase) is our in-house SCM tool.

We do mostly ASP and ASP.NET development using SQL Server.

I've been unsucessful in finding anthing online that discusses processes for revision controlling database objects.

We use the RedGate tools in-house to manage synching our development to staging to live databases but there is nothing in place yet that keeps track of what has changed in the same manner that we do for the rest of the application.

It is important to for us to get this hole fixed as we have a number of apps that have 100-200 sprocs which are the lifeblood of the application(s).

Any thoughts are greatly appreciated.

Kyle Heon
PixelMEDIA, Inc.
Senior Application Programmer, MCP
kheon@pixelmedia.com

gpl
Posting Yak Master

195 Posts

Posted - 2004-04-13 : 17:17:26
Kyle
I dont know how other people do it, but in our place, all the database objects are held as text scripts within Visual Source Safe and these are version controlled, when a release build is done, the whole version is held as another project within VSS - under the Release project, with the build number as the project name.

It doesnt of course stop anyone making uncontrolled changes but those changes get lost when the database is rebuilt, you only do it once (or twice) before you get in the swing of doing it in a controlled way.

Hope this helps

Graham
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-04-13 : 17:21:11
We also put the database objects into text files into VSS, although we are moving to ClearCase. The objects that we track are stored procedures, views, and UDFs. For table changes, I put the change script into VSS, not the actual DDL of the table. We have the base DDL in there, but from there you run the update scripts.

Tara
Go to Top of Page

ajthepoolman
Constraint Violating Yak Guru

384 Posts

Posted - 2004-04-13 : 17:43:59
We also use Source Safe. We number our scripts with the year, month, day and a number. For instance, if I were taking script #1 I would name my script 040413_001 TableOrProcScriptName.

We have an in house app that then takes these scripts and puts them into a folder and executes each one in order against our databases. The numbering is important so you don't try to execute a script that populates a table, without having the table create script before it.

We have had good luck with this system in the 4 years I have been here. Occassionally a script fails to get into Source Safe. That is the only thing that hangs up from time to time.

Aj
Go to Top of Page

gpl
Posting Yak Master

195 Posts

Posted - 2004-04-13 : 18:10:08
AJ
We have a (relatively) simple DOS batch system that uses control files that list the order of execution of scripts - this prevents the problem you describe from occurring
Graham
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-04-13 : 19:47:17
see
http://www.nigelrivett.net/SQLServerReleaseControl.htm

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2004-04-13 : 20:29:30
I do the same as Tara and store change scripts. I use a datestamped naming convention for the scripts to ensure they get applied in order.
I've been working on a tool to keep a track of which change scripts have been applied to which databases so I can automate the rollout of scripts which I use in an automated build process on a staging server.

I use CVS though, it is rumoured that a developer at Microsoft once said "Visual SourceSafe? It would be safer to print out all your code, run it through a shredder, and set it on fire."



Damian
Go to Top of Page

scullee
Posting Yak Master

103 Posts

Posted - 2004-04-13 : 20:39:34
We use CVS and ANT to do everything

Works very well
Go to Top of Page

Lavos
Posting Yak Master

200 Posts

Posted - 2004-04-13 : 21:54:15
Ah, visual sourcesafe who's right of passage is seeing the entire VSS database become corrupt, and forcing a ritual dance as you pray to the gods that a) someone has the latest of everything, and b) that the fixer tool can recover everything.

----------------------
"O Theos mou! Echo ten labrida en te mou kephale!"

"Where theres a will, theres a kludge." - Ken Henderson
Go to Top of Page

KHeon
Posting Yak Master

135 Posts

Posted - 2004-04-14 : 06:55:42
Thanks everyone! A lot of helpful input, much appreciated. I've seen VSS can "integrate" with SQL Server 7/2000 but I'm reluctant to attempt that, especially since we have StarTeam controlling everything else in-house. Hoping to find a way that we can keep revisions of our database scripts in StarTeam as well. Looking for the most automated method as possible too.

Again, thanks everyone!

Kyle Heon
PixelMEDIA, Inc.
Senior Application Programmer, MCP
kheon@pixelmedia.com
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2004-04-14 : 06:57:21
Me beeing the only developer I don't use any type of source-countrol except for the versioning in mssqlXpress from www.xpressapps.com and it's truly awesome, it's sort of an enhanced query analyzer really (no I don't work for them, I don't get paid for saying this)

--
Lumbago
"Real programmers don't document, if it was hard to write it should be hard to understand"
Go to Top of Page
   

- Advertisement -