Monday, January 10, 2011

Sql Server Get table data (.csv) excuting bat file

How To get sql server Table all records in Csv file by excuting .bat file in Client machine

sample Bat file

1)Open Notepad

2)SQLCMD -S .\SQLEXPRESS -d DatabaseName -E -Q "select * from tableName" -o "FileName.csv" -h-1 -s"," -w 700

3)save as .bat File

No comments: