You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/odbc/reference/develop-app/batches-of-sql-statements.md
+25-26Lines changed: 25 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,10 +14,11 @@ helpviewer_keywords:
14
14
- "batches [ODBC], about batches"
15
15
---
16
16
# Batches of SQL Statements
17
-
A batch of SQL statements is a group of two or more SQL statements or a single SQL statement that has the same effect as a group of two or more SQL statements. In some implementations, the entire batch statement is executed before any results are available. This is often more efficient than submitting statements separately, because network traffic can often be reduced and the data source can sometimes optimize execution of a batch of SQL statements. In other implementations, calling **SQLMoreResults** triggers the execution of the next statement in the batch. ODBC supports the following types of batches:
18
-
19
-
-**Explicit Batches** An *explicit batch* is two or more SQL statements separated by semicolons (;). For example, the following batch of SQL statements opens a new sales order. This requires inserting rows into both the Orders and Lines tables. Note that there is no semicolon after the last statement.
20
-
17
+
18
+
A batch of SQL statements is a group of two or more SQL statements or a single SQL statement that has the same effect as a group of two or more SQL statements. In some implementations, the entire batch statement is executed before any results are available. This is often more efficient than submitting statements separately, because network traffic can often be reduced and the data source can sometimes optimize execution of a batch of SQL statements. In other implementations, calling **SQLMoreResults** triggers the execution of the next statement in the batch. ODBC supports the following types of batches:
19
+
20
+
-**Explicit Batches** An *explicit batch* is two or more SQL statements separated by semicolons (;). For example, the following batch of SQL statements opens a new sales order. This requires inserting rows into both the Orders and Lines tables. Note that there's no semicolon after the last statement.
21
+
21
22
```
22
23
INSERT INTO Orders (OrderID, CustID, OpenDate, SalesPerson, Status)
@@ -29,34 +30,32 @@ A batch of SQL statements is a group of two or more SQL statements or a single S
29
30
VALUES (2002, 3, 566, 17);
30
31
INSERT INTO Lines (OrderID, Line, PartID, Quantity)
31
32
VALUES (2002, 4, 412, 500)
32
-
```
33
-
34
-
- **Procedures** If a procedure contains more than one SQL statement, it is considered to be a batch of SQL statements. For example, the following SQL Server-specific statement creates a procedure that returns a result set containing information about a customer and a result set listing all the open sales orders for that customer:
35
-
33
+
```
34
+
35
+
- **Procedures** If a procedure contains more than one SQL statement, it's considered to be a batch of SQL statements. For example, the following SQL Server-specific statement creates a procedure that returns a result set containing information about a customer and a result set listing all the open sales orders for that customer:
36
+
36
37
```
37
38
CREATE PROCEDURE GetCustInfo (@CustomerID INT) AS
38
39
SELECT * FROM Customers WHERE CustID = @CustomerID
39
40
SELECT OrderID FROM Orders
40
41
WHERE CustID = @CustomerID AND Status = 'OPEN'
41
-
```
42
-
43
-
The **CREATE PROCEDURE** statement itself is not a batch of SQL statements. However, the procedure it creates is a batch of SQL statements. No semicolons separate the two **SELECT** statements because the **CREATE PROCEDURE** statement is specific to SQL Server, and SQL Server does not require semicolons to separate multiple statements in a **CREATE PROCEDURE** statement.
44
-
45
-
- **Arrays of Parameters** - Arrays of parameters can be used with a parameterized SQL statement as an effective way to perform bulk operations. For example, arrays of parameters can be used with the following **INSERT** statement to insert multiple rows into the Lines table while executing only a single SQL statement:
46
-
42
+
```
43
+
44
+
The **CREATE PROCEDURE** statement itself isn't a batch of SQL statements. However, the procedure it creates is a batch of SQL statements. No semicolons separate the two **SELECT** statements because the **CREATE PROCEDURE** statement is specific to SQL Server, and SQL Server doesn't require semicolons to separate multiple statements in a **CREATE PROCEDURE** statement.
45
+
46
+
- **Arrays of Parameters** - Arrays of parameters can be used with a parameterized SQL statement as an effective way to perform bulk operations. For example, arrays of parameters can be used with the following **INSERT** statement to insert multiple rows into the Lines table while executing only a single SQL statement:
47
+
47
48
```
48
49
INSERT INTO Lines (OrderID, Line, PartID, Quantity)
49
50
VALUES (?, ?, ?, ?)
50
-
```
51
-
52
-
If a data source doesn't support arrays of parameters, the driver can emulate them by executing the SQL statement once for each set of parameters. For more information, see [Statement Parameters](../../../odbc/reference/develop-app/statement-parameters.md) and [Arrays of Parameter Values](../../../odbc/reference/develop-app/arrays-of-parameter-values.md), later in this article.
53
-
54
-
The different types of batches can't be mixed in an interoperable manner. That is, how an application determines the result of executing an explicit batch that includes procedure calls, an explicit batch that uses arrays of parameters, and a procedure call that uses arrays of parameters is driver-specific.
55
-
51
+
```
52
+
53
+
If a data source doesn't support arrays of parameters, the driver can emulate them by executing the SQL statement once for each set of parameters. For more information, see [Statement Parameters](../../../odbc/reference/develop-app/statement-parameters.md) and [Arrays of Parameter Values](../../../odbc/reference/develop-app/arrays-of-parameter-values.md), later in this article.
54
+
55
+
The different types of batches can't be mixed in an interoperable manner. That is, how an application determines the result of executing an explicit batch that includes procedure calls, an explicit batch that uses arrays of parameters, and a procedure call that uses arrays of parameters is driver-specific.
56
+
56
57
## Related content
57
-
58
-
- [Result-Generating and Result-Free Statements](../../../odbc/reference/develop-app/result-generating-and-result-free-statements.md)
Copy file name to clipboardExpand all lines: docs/t-sql/statements/create-symmetric-key-transact-sql.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,7 @@ Specifies a passphrase from which to derive the key.
91
91
92
92
#### IDENTITY_VALUE = '*identity_phrase*'
93
93
94
-
Specifies an identity phrase from which to generate a GUID for tagging data that is encrypted with a temporary key.
94
+
Specifies an identity phrase from which to generate a GUID for tagging data that's encrypted with a temporary key.
95
95
96
96
#### PROVIDER_KEY_NAME = '*key_name_in_provider*'
97
97
@@ -118,15 +118,15 @@ Specifies the name of the certificate that is used to encrypt the symmetric key.
118
118
119
119
#### '*password*'
120
120
121
-
Specifies a password from which to derive a TRIPLE_DES key with which to secure the symmetric key. `password` must meet the Windows password policy requirements of the computer that is running the instance of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)]. Always use strong passwords.
121
+
Specifies a password from which to derive a TRIPLE_DES key with which to secure the symmetric key. `password` must meet the Windows password policy requirements of the computer that's running the instance of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)]. Always use strong passwords.
122
122
123
123
#### *symmetric_key_name*
124
124
125
-
Specifies a symmetric key, used to encrypt the key that is being created. The specified key must already exist in the database, and the key must be open.
125
+
Specifies a symmetric key, used to encrypt the key that's being created. The specified key must already exist in the database, and the key must be open.
126
126
127
127
#### *asym_key_name*
128
128
129
-
Specifies an asymmetric key, used to encrypt the key that is being created. This asymmetric key must already exist in the database.
129
+
Specifies an asymmetric key, used to encrypt the key that's being created. This asymmetric key must already exist in the database.
130
130
131
131
#### \<algorithm>
132
132
@@ -156,7 +156,7 @@ The optional password can be used to encrypt the symmetric key before distributi
156
156
157
157
Temporary keys are owned by the user that creates them. Temporary keys are only valid for the current session.
158
158
159
-
`IDENTITY_VALUE` generates a GUID with which to tag data that is encrypted with the new symmetric key. This tagging can be used to match keys to encrypted data. The GUID generated by a specific phrase is always the same. After a phrase has been used to generate a GUID, the phrase can't be reused as long as there's at least one symmetric key in this database that is actively using the phrase. `IDENTITY_VALUE` is an optional clause; however, we recommend using it when you're storing data encrypted with a temporary key.
159
+
`IDENTITY_VALUE` generates a GUID with which to tag data that's encrypted with the new symmetric key. This tagging can be used to match keys to encrypted data. The GUID generated by a specific phrase is always the same. After a phrase has been used to generate a GUID, the phrase can't be reused as long as there's at least one symmetric key in this database that is actively using the phrase. `IDENTITY_VALUE` is an optional clause; however, we recommend using it when you're storing data encrypted with a temporary key.
0 commit comments