user3461957
user3461957

Reputation: 163

What is meant by "batches" in the context of SQL Server and ADO.NET?

While looking for information about Multiple Active Result Sets(MARS) on MSDN. Thing which confuses me is usage of word "Batched" in following statement.

Multiple Active Result Sets (MARS) is a feature that allows the execution of multiple batches on a single connection. In previous versions, only one batch could be executed at a time against a single connection. Executing multiple batches with MARS does not imply simultaneous execution of operations.

On another website(this one) I found that MARS helps to execute multiple queries without closing single connection. Question is how this "batches" thing fits in here & what does this mean?

Upvotes: 1

Views: 256

Answers (2)

usr
usr

Reputation: 171188

A batch is a SQL string that you send for execution to SQL Server. It can contain multiple statements. Every time you call SqlCommand.Execute* you send a single batch.

Upvotes: 1

user3804714
user3804714

Reputation:

batches in normally related to SQL. It is a set of a set of actions that are to be performed. Like if you have thousands of row that are to be inserted into a database you would create a batch and have it scheduled to run at night time.

Upvotes: 1

Related Questions