1

Can I write SQL insert, update and delete commands in a batch file? If I can do so can someone give me an example please.

Sarah117
  • 91
  • 1
  • 7

1 Answers1

1

write the sql code and save as .sql extension. (code.sql) then call it from a batch file, eg @echo off sqlcmd -S <ComputerName>\<InstanceName> -i code.sql

Save this as a *.bat file.

Dibakar Paul
  • 166
  • 11