command line tool for export data from server to server
In SqlServer Management Studio, if we click on data database there is menu task > export data. This help me to export this database to another server.
However, I need to run this wizard to complete this task and need to specify source and destination sever information every time that I want to use it.
I think it would be convenient if I could use command line to do the same task and write batch file to automate it.
Please could you help me give some suggestion or introduce me a command line program that can do this task since I googled search but not found any useful information.
Thank you so much.
U can use BCP Utility
BCP Out BCP server.schema.TableName out c:\TableName.txt -c -t -T –SServerName -UUsername -Password BCP In BCP server.schema.TableName In c:\TableName.txt -c -t -T –SServerName -UUsername -Password
The 1st statement is to export the data to a csv file and BCP IN is used to import the data from csv file to Destination table
Here -T stands for Trusted connection and -t represents field delimeter
You can write these BCP commands in batch file
Or you can create a simple ssis package for exporting the data