Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Examples of using batches [Table of Contents] Using control-of-flow language

Transact-SQL User's Guide

[-] Chapter 13 Using Batches and Control-of-Flow Language
[-] Rules associated with batches
[-] Batches submitted as files

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.


Examples of using batches [Table of Contents] Using control-of-flow language