Tuesday, January 21, 2014

How do I use SQLCMD in SQL Server 2005?

SQLCMD lets you write SQL Commands as well as T-SQL Statements and it is the preferred command-line utility in SQL Server 2005. SQLCMD can also be run within SQL Server Managment Studio and runs in side a query pane by enabling the SQLCMD Mode in SQL Server Management Studio from the Query menu's drop-down list.



One of the requirements for running the SQLCMD from the command line (in a DOS screen) is that the client and the server should be listening on/to the same TCP Port. This can be set using the SQL Server Configuration Manager.

Here is an example fo SQLCMD run from command-line.


Commandline access to the program is perhaps one of the nicest features any program can have and the keyboard wizards love them. They can do most things you want done as long as you understand the switches and when & how to use them. A good wizard does most of the things these days, but cannot beat the command-line.

Did I hear you say, short and sweet?

No comments:

Post a Comment

I am not paying this invoice. I am disregarding it, becuase....

 I am not paying this invoice because MICROSOFT has not provided me with a satisfactory way to access my account since June of this year des...