Partager via


Running Batch and Multiple SQL Queries from an IDC File on IIS

In an .idc file, you can group SQL queries in two ways, as Batch Queries or as Multiple Queries.

Batch Queries

If you are querying databases that can simultaneously process several queries in an SQL statement, such as SQL Server database, you should format your statements in batch query syntax to optimize performance. For example:

SQLSTatement: 
+insert into perf(testtime, tag) values (getdate(), '%tag%') 
+SELECT au_lname, ytd_sales from pubs.dbo.titleview where ytd_sales>5000 
+SELECT count(*) as nrecs from pubs.dbo.titleview where ytd_sales>5000 

Batch queries are processed together at once, whereas multiple queries are processed one at a time. Therefore, you will get better performance by formatting your queries as a batch if your database can handle batch queries.

Multiple Queries

If you are querying databases that cannot process a series of SQL queries simultaneously, formulate your queries as multiple queries. For example:

SQLStatement: 
+insert into perf(testtime, tag) values (getdate(), '%tag%') 
SQLStatement: 
+SELECT au_lname, ytd_sales from pubs.dbo.titleview where ytd_sales>5000 
SQLStatement: 
+SELECT count(*) as nrecs from pubs.dbo.titleview where ytd_sales>5000 

Batch queries are processed together at once, whereas multiple queries are processed one at a time. Therefore, you will get better performance by formatting your queries as a batch if your database can handle batch queries.