How to Run SQL Query from Command Prompt

There are times when you want to run massive sql queries that they can’t be loaded into SQL Server Management Studio query editor. This is where running the SQL queries from the command prompt come in handy.

 

sqlcmd -S server -U username -P password -i input_file -o output_file

Advertisements

One thought on “How to Run SQL Query from Command Prompt

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s