开发者

Quickly generate ascii text sql scripts based off of sql 2008 database

This is starting to frustrate me, mostly because it should be easy to do but I can't find anything.

I am trying to version control my database. The method I have decided upon is to generate scripts at each check-in that creates a sql script for every object in my database. Most of my edits are done via the visual designer in SSMS and I don't trust myself to remember to generate change scripts every time. I am only concerned with the schema for now, although soon I would like data from certain lookup tables.

I have tried the following with not much success:

  • I attempted to generate scripts via SSMS Tasks->Generate Scripts. I don't like this for two reasons.

    • It does not seem to save what settings you give it, so every time I want to generate scripts I have to c开发者_如何学Change the settings to what I want, change the output path, etc.. I really just want to press a button or two and be a quick pre-commit process.

    • it seems to generate scripts using USC formatting, which means version control (git) sees it as being a binary file and thus can't do comparisons between versions (which is one of the big reasons I want to store the DB in version control).

  • I also attempted to use dbSourceTools. This tool fixed issue #1 from SMSS and made it real easy to update the schema definitions, yet the .sql files it generated used USC formatted text as well, which meant version control saw it as a binary file.

I am looking for a free method to do this as I am working on a hobby project right now.


If you are using Visual Studio Developer Edition or Visual Studio Team Suite, you can use Visual Studio Database Professional for free. This is a fantastic tool for managing your database schema.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜