SQL Server Management Studio command line?

Is there a command line interface where I can run a script that says, for example: Connect to the server Run the request 1 Connect to the server b Run the request 2 Run the request 3

I tried searching the Internet but could not find anything built into SQL Server Management Studio. Thanks!

+4
source share
2 answers

sqlcmd utility

http://msdn.microsoft.com/en-us/library/ms162773.aspx

It usually ships with the SQL Server installer and is located in the following directory by default:

C:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLCMD.EXE 
+10
source

If you want to export to / from, there is a command line utility called BCP that allows you to execute these types of processes.

bcp utility

The bcp bulk copy utility copies data between an instance of Microsoft SQL Server and a data file in a user-specified format. The bcp utility can be used to import a large number of new rows into SQL Server tables or to export data from tables to data files. Except when the query option, the utility does not require knowledge of Transact-SQL. To import data into a table, you must either use the format file created for this table, or understand the structure of the table and the data types that are valid for your columns.

+1
source

All Articles