SQLCMD will be fun

SQLCMD is a command line utility for Sql Server 2005. Like osql and isql, it can be used interactively. It can also be used as a scripting tool to automate a lot of routine tasks. It is the later part that I find exciting and fun. (By the way, isql is not available in Sql Server 2005. osql is there, but probably won’t be there in the next release of Sql Server, shall I say, Sql Server 2010;)

One big improvement I see SQLCMD over osql is the ability to set your own customized variables. This may seem trival but actually provides great flexibility and versatility in doing your day to day tasks.

For example, in a typical development cycle, you will be asked to promote sql code from dev environment to QA, Cert, and/or Prod. With the setvar command, all these can be done in a single script, if you define your environment variables properly.

I will write more on this in future posts.

In other news, I was able to finish silent / command line install of Sql Server 2005, but I had to choose to install ALL components. I will see if I can find a good sample of ADDLOCAL and test that. I will blog that when I make progress.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.