65.9K
CodeProject is changing. Read more.
Home

Execute SQL Query / SQL Command on SQL Server Using the Command Prompt

emptyStarIconemptyStarIconemptyStarIconemptyStarIconemptyStarIcon

0/5 (0 vote)

Feb 3, 2012

CPOL
viewsIcon

13510

SQLCMD can be used to login to the Sql Server as well. One can only provide Server address, User Name and Password at the command prompt and press enter.The command prompt will change to 1>. Now any sql query can typed and by pressing enter in the next prompt a GO command and pressing enter...

SQLCMD can be used to login to the Sql Server as well. One can only provide Server address, User Name and Password at the command prompt and press enter. The command prompt will change to 1>. Now any sql query can typed and by pressing enter in the next prompt a GO command and pressing enter will execute the query and show the result on the screen. This can be used when there is no SSMS available and just need to check any tables or execute any queries for maintenance.