Source Safe and DB

  • Hello All,

    How do you store different versions of DB involved with each software build?

    Thanks,

    Rajesh

  • If you're using SourceSafe, one thing you can script the whole database. As long as you use the same scripting options each time, you have two scripts which are comparable to verify what changed.

    Our change control personnel script a production database every time a change is put in (or at least, when they get paperwork for a change). They'll then use VSS to compare with the previous script. If they flag a change that shouldn't be there, we have to explain it to management. It's one of the checks to make sure the DBA group isn't acting with absolute impunity!

    K. Brian Kelley

    bkelley@sqlservercentral.com

    http://www.sqlservercentral.com/columnists/bkelley/

    K. Brian Kelley
    @kbriankelley

  • Hi Brian,

    I was thinking of doing the same, but was not sure if that's the right approach(I am not a DB guy).

    Thanks for the help ,

    Rajesh

  • There are also some articles around the web with regards to integrating VSS more tightly with SQL server... rather than using it just as a repository of scripted databases. We've not had the need for that where I work, but I know others have.

    K. Brian Kelley

    bkelley@sqlservercentral.com

    http://www.sqlservercentral.com/columnists/bkelley/

    K. Brian Kelley
    @kbriankelley

  • Have a look at the free software available here for ArchUtil.

    ArchUtil will sourcesafe a database for you, as well as version control. I use it to keep a stored copy of each version of the production database, as well as a daily 'changes' track of the development system.

    And excellent piece of software that I couldn't recommend enough.


    ---------------------------------------
    It is by caffeine alone I set my mind in motion.
    It is by the Beans of Java that thoughts acquire speed,
    the hands acquire shaking, the shaking becomes a warning.
    It is by caffeine alone I set my mind in motion.

  • I cannot find this ArchUtil you talk about. Can you provide either a link or more specific details about it? Is that the correct name (I googled on it and came up with nothing relavant).

  • doh, never mind. I found it on this site.

    here's the url:

    http://www.sqlservercentral.com/products/bwunder/archiveutility/

  • I use SourceSafe, but script the entire db, everything, and be sure it is branched when the software code cuts. I'd keep this in a separate project with the date or build #.

    Steve Jones

    sjones@sqlservercentral.com

    http://www.sqlservercentral.com/columnists/sjones

  • quote:


    Have a look at the free software available here for ArchUtil.


    I agree although I've actually had more success using the underlying DTS scripts directly as opposed to the ArchUtil GUI.

    I needed to make these two changes. Both were trivial and I'd be glad to post the relevant pieces for anyone intersted.

    1.) Since our servers are offsite, we needed to modify the ScriptDB piece to use a nontrusted login.

    2.) I wanted to use a standard SQL file extension instead of the object-specific extensions used by the original.

    -Kevin

  • quote:


    Have a look at the free software available here for ArchUtil.


    I agree although I've actually had more success using the underlying DTS scripts directly as opposed to the ArchUtil GUI.

    I needed to make these two changes. Both were trivial and I'd be glad to post the relevant pieces for anyone intersted.

    1.) Since our servers are offsite, we needed to modify the ScriptDB piece to use a nontrusted login.

    2.) I wanted to use a standard SQL file extension instead of the object-specific extensions used by the original.

    -Kevin

  • We have our developement team script each sql object and have all scripts checked into VSS daily, just like ASP and HTML pages.

    Another alternative is the Microsoft DataEnvironment (built into visual studio).

    It gives a full set of database editing tools (for views, SPs, tables, etc.) with automatic VSS integration.

    (see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql7/html/sql7storprocvers.asp)

    We tried using it at one time but it ended up being too much of a bother, especially since you have to use the MS IDE.

    - Avi

  • Depends on the script. If you do a script the whole database, then no, it will not. the database itself doesn't know about what is changed and what is not.

    I use scripts for everything. If I create a table, this script has the drop and create statements, along with permissions inside it. If I add fields, then I use an Alter script to make the changes and deploy them to other servers.

    Steve Jones

    sjones@sqlservercentral.com

    http://www.sqlservercentral.com/columnists/sjones

  • We are starting to look a product call "Change Manager" by Embarcadaro. It will allow you to version your database and compare live databases to live database to report differences. Also will generate scripts to migrate differences between database. Seems to also have the capability to backout implemented changes. We are planning on using Change Manager to track database changes, but are only investigating how to use and implement the tool. One note, is this tool has a few bugs but the vendor seems to be open to customer input and suggestions for enhancements, so I suspect that someday this product might be quite good at handling version control and managing change in your environment.

    -------------------------

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

  • I agree with Avi. We're also checking separate scripts into VSS and finding there are a few other benefits to storing each object separately.

    Firstly we've found that by keeping the objects distinct from each other reusing code has become much easier, and we're building a pretty decent collection. Another unexpected bonus is that by assigning permissions as a last step in every script we're self documenting the security requirements for each database. And lastly for me it all becomes much much easier mirroring individual database objects between separate environments.

    ry..

    quote:


    We have our developement team script each sql object and have all scripts checked into VSS daily, just like ASP and HTML pages.

    Another alternative is the Microsoft DataEnvironment (built into visual studio).

    It gives a full set of database editing tools (for views, SPs, tables, etc.) with automatic VSS integration.

    (see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql7/html/sql7storprocvers.asp)

    We tried using it at one time but it ended up being too much of a bother, especially since you have to use the MS IDE.

    - Avi


    Ryan
    -----------------
    www.quadrus.com

  • What you can do is build a database that has the schema as it should be. Then use a tool like SQL Compare to check the differences in the schema. It'll not only give you a visual display of what's different, it'll build scripts to resolve the differences.

    SQL Compare:

    http://www.red-gate.com/

    Basically, all it seems to do is script the two databases and then does a line by line compare, like what you would get with SourceSafe. The difference is that it'll be able to generate the scripts to bring the second database into sync for you.

    K. Brian Kelley

    http://www.truthsolutions.com/

    Author: Start to Finish Guide to SQL Server Performance Monitoring

    http://www.netimpress.com/shop/product.asp?ProductID=NI-SQL1

    K. Brian Kelley
    @kbriankelley

Viewing 15 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic. Login to reply