• RSS
  • Add To My MSN
  • Add To Windows Live
  • Add To My Yahoo
  • Add To Google

Statistics

  • Entries (4)
  • Comments (0)

Bulk insert SQL Batchfile 

Tuesday, June 28, 2011 12:01:00 PM

CODE

sqlcmd -U [user id] -P [password] -S [server] -d [database] -i [full path to script] -o [full path to log file]

example
 

CODE

sqlcmd -U foo -P bar -S .\SqlExpress -d MyDB -i "c:\scripts\restore.sql" -o "c:\db logs\restore.log"

-o is good for logging errors and print statments. without it errors are not logged (i think.)

Comments are closed on this post.