Sunday, November 21, 2010

Use of SQLCMD

Using SSMS, we can perform T-SQL batch operations on databases.
The same can be done using SQLCMD in appropriate situations.
1. Open command prompt and type sqlcmd -? to get the available commands information
2. sqlcmd -H 'hostname' -S 'servername' -D 'database'
3. Using sqlcmd -Q 'SQL query' and sqlcmd -q 'SQL query', batch operations can be achieved.

To know more about SQLCMD, please click link here.
Hope this post helps you,
Reference: DP (http://dptechnicalblog.blogspot.com/)

No comments:

Post a Comment