Thursday, March 21, 2013

Accessing MS SQL DATABASE FROM COMMAND PROMPT

To access MS SQL database from command prompt follow below steps in line:-

1.) Locate sqlcmd on your machine and trace down to its path from command prompt.

2.) To access named instance, use below command refer help for switches explanation.

SQLCMD -S SERVERNAME\INSTANCENAME –E

3.) Once connection is established it will prompt screen as


4.) Use below command to check out DB instances.

sp_databases
Go




on command prompt to execute any query we need to set go and then press enter.


No comments:

Post a Comment