How to Export SQL table records using a Windows Batch file (.bat) | Ms SQL

Veröffentlicht am: 01 Mai 2022
auf dem Kanal: Right to Learn @BK
23,666
277

Export SQL query results with just a click.

In this video i have given a demo on how to Create a Batch File to Export SQL Query Results to a CSV/text file.
SQLCMD -S A103 -d demo -E -Q "select * from customer" -s "," -o "C:\A103\customer.csv"

sqlcmd is the command
-S   server name. Here, it is A103
-d  database name.
-E   trusted connection (Windows)
In case of SQL login  -u user_name -p p@$$word@123
-Q   Write your query in quotes:
“select * from report“
-s   column separator
Example : comma  ", "
-o   location where your file will be saved: "C:\A103\customer.csv"

How to export data from SQL server to Excel - Click below to watch the video
   • How to export data from SQL server to Exce...  

How to import data from excel to SQL server - Click below to watch the video
   • How to import data from excel to SQL serve...  


Auf dieser Seite können Sie das Online-Video How to Export SQL table records using a Windows Batch file (.bat) | Ms SQL mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Right to Learn @BK 01 Mai 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 23,666 Mal angesehen und es wurde von 277 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!