Batches submitted as files

You can submit one or more batches of Transact-SQL statements to isql from an operating system file. A file can include more than one batch, that is, more than one collection of statements, each terminated by the word “go.”

For example, an operating system file might contain the following three batches:

use pubs2 
go 
select count(*) from titles 
select count(*) from authors 
go 
create table hello 
   (column1 char(10), column2 int) 
insert hello 
   values ("hello", 598) 
select * from hello 
go

Here are the results of submitting this file to the isql utility:

------------- 
           18 
 
(1 row affected) 
------------- 
           23 
 
(1 row affected) 
column1      column2 
---------    --------- 
hello              598 
 
(1 row affected) 

See isql in the Utility Guide for environment-specific information about running batches stored in files.