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
You can control the type of cursor used either by setting SQL_ATTR_CURSOR_TYPE and SQL_ATTR_CONCURRENCY, or by setting SQL_ATTR_CURSOR_SENSITIVITY and SQL_ATTR_CURSOR_SCROLLABLE. You should not mix the two methods of specifying cursor behavior.
34
34
35
-
## Example
35
+
## Examples
36
+
37
+
### A. Set a dynamic cursor
38
+
36
39
The following sample allocates a statement handle, sets a dynamic cursor type with row versioning optimistic concurrency, and then executes a SELECT.
Copy file name to clipboardExpand all lines: docs/relational-databases/native-client-odbc-table-valued-parameters/sending-data-as-a-table-valued-parameter-using-data-at-execution-odbc.md
+5-7Lines changed: 5 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -179,9 +179,9 @@ from @Items
179
179
}
180
180
```
181
181
182
-
## Example
182
+
## Examples
183
183
184
-
### Description
184
+
### A. Use row streaming, one row per call
185
185
This sample shows that you can use row streaming, one row per call to SQLPutData, with ODBC TVP, similar to how you might use BCP.exe to load data into a database.
186
186
187
187
Before building the sample, change the server name in the connection string.
This sample shows that you can use row streaming, multiple rows per call to SQLPutData, with ODBC TVP, similar to how you might use BCP.exe to load data into a database.
374
372
375
373
Before building the sample, change the server name in the connection string.
Use the **Select Partition Switching-Out options** page to select the partition and the staging table to hold the partitioned data that you are switching out of the partitioned table.
106
106
107
-
## UI element list
107
+
###UI element list
108
108
**Partition grid**
109
109
Displays the partition name, **Left boundary**, **Right boundary**, **Filegroup**, and **Row count** of the partitions you selected.
110
110
@@ -126,7 +126,7 @@ ms.author: jrasnick
126
126
127
127
You can also create the same indexes in the staging table that exist in the source partition. The staging table automatically contains a constraint based on the elements of the source partition. This constraint is typically generated from the boundary value of the source partition.
128
128
129
-
## UI element list
129
+
###UI element list
130
130
**Staging table name**
131
131
Create a name for the staging table or accept the default name displayed in the edit box.
132
132
@@ -254,7 +254,7 @@ ms.author: jrasnick
254
254
## <aname="Summary"></a> Summary Page
255
255
Use the **Summary** page to review the options that you have selected on the previous pages.
256
256
257
-
## UI element list
257
+
###UI element list
258
258
**Review your selections**
259
259
Displays the selections you have made for each page of the wizard. Click a node to expand and view your previously selected options.
Copy file name to clipboardExpand all lines: docs/relational-databases/replication/administration/upgrade-replication-scripts-replication-transact-sql-programming.md
- For a push subscription, execute [sp_addmergepushsubscription_agent (Transact-SQL)](../../../relational-databases/system-stored-procedures/sp-addmergepushsubscription-agent-transact-sql.md) at the Publisher. Specify `@subscriber`, `@subscriber_db`, `@publication`, the Windows credentials under which the Merge Agent at the Distributor runs for `@job_name` and `@job_password`, and a schedule for this agent job. For more information, see [Specify Synchronization Schedules](../../../relational-databases/replication/specify-synchronization-schedules.md). This is done after the execution of [sp_addmergesubscription](../../../relational-databases/system-stored-procedures/sp-addmergesubscription-transact-sql.md). For more information, see [Create a Push Subscription](../../../relational-databases/replication/create-a-push-subscription.md).
108
108
109
-
## Example
109
+
## Examples
110
+
111
+
### A. SQL Server 2000 script to create a transactional publication
112
+
110
113
The following is an example of a [!INCLUDE[ssVersion2000](../../../includes/ssversion2000-md.md)] script that creates a transactional publication for the Product table. This publication supports immediate updating with queued updating as failover. Default parameters have been removed for readability.
### B. SQL Server 2005 and later script to create a transactional publication
115
118
The following is an example of upgrading the previous script, which creates a transactional publication, to run successfully for [!INCLUDE[ssVersion2005](../../../includes/ssversion2005-md.md)] and later versions. This publication supports immediate updating with queued updating as failover. Defaults for new parameters have been explicitly declared.
116
119
117
120
> [!NOTE]
118
121
> Windows credentials are supplied at runtime using **sqlcmd** scripting variables.
### C. SQL Server 2000 script to create a merge publication
123
126
The following is an example of a [!INCLUDE[ssVersion2000](../../../includes/ssversion2000-md.md)] script that creates a merge publication for the Customers table. Default parameters have been removed for readability.
### D. SQL Server 2005 and later script to create a merge publication
128
131
The following is an example of the previous script, which creates a merge publication, upgraded to run successfully for [!INCLUDE[ssVersion2005](../../../includes/ssversion2005-md.md)] and later versions. Defaults for new parameters have been explicitly declared.
129
132
130
133
> [!NOTE]
131
134
> Windows credentials are supplied at runtime using **sqlcmd** scripting variables.
### E. SQL Server 2000 script to create a push subscription to a transactional publication
136
139
The following is an example of a [!INCLUDE[ssVersion2000](../../../includes/ssversion2000-md.md)] script that creates a push subscription to a transactional publication. Default parameters have been removed for readability.
### F. SQL Server 2005 and later script to create a push subscription to a transactional publication
141
144
The following is an example of the previous script, which creates a push subscription to a transactional publication, upgraded to run successfully for [!INCLUDE[ssVersion2005](../../../includes/ssversion2005-md.md)] and later versions. Defaults for new parameters have been explicitly declared.
142
145
143
146
> [!NOTE]
144
147
> Windows credentials are supplied at runtime using **sqlcmd** scripting variables.
### G. SQL Server 2000 script to create a push subscription to a merge publication
149
152
The following is an example of a [!INCLUDE[ssVersion2000](../../../includes/ssversion2000-md.md)] script that creates a push subscription to a merge publication. Default parameters have been removed for readability.
### H. SQL Server 2005 and later script to create a push subscription to a merge publication
154
157
The following is an example of the previous script, which creates a push subscription to a merge publication, upgraded to run successfully for [!INCLUDE[ssVersion2005](../../../includes/ssversion2005-md.md)] and later versions. Defaults for new parameters have been explicitly declared.
155
158
156
159
> [!NOTE]
157
160
> Windows credentials are supplied at runtime using **sqlcmd** scripting variables.
### I. SQL Server 2000 script to create a pull subscription to a transactional publication
162
165
The following is an example of a [!INCLUDE[ssVersion2000](../../../includes/ssversion2000-md.md)] script that creates a pull subscription to a transactional publication. Default parameters have been removed for readability.
### J. SQL Server 2005 and later script to create a pull subscription to a transactional publication
167
170
The following is an example of the previous script, which creates a pull subscription to a transactional publication, upgraded to run successfully for [!INCLUDE[ssVersion2005](../../../includes/ssversion2005-md.md)] and later versions. Defaults for new parameters have been explicitly declared.
168
171
169
172
> [!NOTE]
170
173
> Windows credentials are supplied at runtime using **sqlcmd** scripting variables.
### K. SQL Server 2000 script to create a pull subscription to a merge publication
175
178
The following is an example of a [!INCLUDE[ssVersion2000](../../../includes/ssversion2000-md.md)] script that creates a pull subscription to a merge publication. Default parameters have been removed for readability.
### L. SQL Server 2005 and later script to create a pull subscription to a merge publication
180
183
The following is an example of the previous script, which creates a pull subscription to a merge publication, upgraded to run successfully for [!INCLUDE[ssVersion2005](../../../includes/ssversion2005-md.md)] and later versions. Defaults for new parameters have been explicitly declared.
Copy file name to clipboardExpand all lines: docs/relational-databases/replication/security/replicate-data-in-encrypted-columns-sql-server-management-studio.md
11. Execute [CLOSE SYMMETRIC KEY](../../../t-sql/statements/close-symmetric-key-transact-sql.md) to close the key.
72
72
73
-
## Example
73
+
## Examples
74
+
75
+
### A. Create keys in the publication database
74
76
This example creates a symmetric key, a certificate that is used to help secure the symmetric key, and a master key. These keys are created in the publication database. They are then used to create an encrypted column (EncryptedCreditCardApprovalCode) in the `SalesOrderHeader` table. This column is published in the AdvWorksSalesOrdersMerge publication instead of the unencrypted CreditCardApprovalCode column. When possible, prompt users to enter security credentials at runtime. If you must store credentials in a script file, you must secure the file to prevent unauthorized access.
This example recreates the same symmetric key in the subscription database using the same values for ALGORITHM, KEY_SOURCE, and IDENTITY_VALUE from the first example. This example assumes that you have already initialized a subscription to the AdvWorksSalesOrdersMerge publication to replicate the encrypted column. When possible, prompt users to enter security credentials at runtime. If you must store credentials in a script file, you must secure the file during storage and transport to prevent unauthorized access.
Copy file name to clipboardExpand all lines: docs/relational-databases/sql-trace/create-a-trace-transact-sql.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,9 +32,11 @@ ms.author: "mathoma"
32
32
> [!IMPORTANT]
33
33
> Unlike regular stored procedures, parameters of all SQL Server Profiler stored procedures (<strong>sp_trace_*xx*</strong>) are strictly typed and do not support automatic data type conversion. If these parameters are not called with the correct input parameter data types, as specified in the argument description, the stored procedure returns an error.
34
34
35
-
## Example
35
+
## Examples
36
+
36
37
The following code demonstrates creating a trace using [!INCLUDE[tsql](../../includes/tsql-md.md)]. It is in three sections: creating the trace, populating the trace file, and stopping the trace. Customize the trace by adding the events that you want to trace. For the list of events and columns, see [sp_trace_setevent (Transact-SQL)](../../relational-databases/system-stored-procedures/sp-trace-setevent-transact-sql.md).
37
38
39
+
### A. Create a trace
38
40
The following code creates a trace, adds events to the trace, and then starts the trace:
39
41
40
42
```
@@ -67,7 +69,7 @@ GO
67
69
68
70
```
69
71
70
-
##Example
72
+
### B. Populate the trace file
71
73
Now that the trace has been created and started, execute the following code to populate the trace with activity.
72
74
73
75
```
@@ -78,7 +80,7 @@ GO
78
80
79
81
```
80
82
81
-
##Example
83
+
### C. Stop the trace
82
84
The trace can be stopped and restarted at any time. In this example, execute the following code to stop the trace, close the trace, and delete the trace definition.
This topic describes how to create a [!INCLUDE[tsql](../../includes/tsql-md.md)] stored procedure by using [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] and by using the [!INCLUDE[tsql](../../includes/tsql-md.md)] CREATE PROCEDURE statement.
24
24
25
-
## <aname="Top"></a>
26
25
-**Before you begin:**[Permissions](#Permissions)
27
26
28
27
-**To create a procedure, using:**[SQL Server Management Studio](#SSMSProcedure), [Transact-SQL](#TsqlProcedure)
@@ -126,7 +125,6 @@ This topic describes how to create a [!INCLUDE[tsql](../../includes/tsql-md.md)]
**sp_check_for_sync_trigger** is used to coordinate between replication and user-defined triggers. This stored procedure determines if it is being called within the context of a replication trigger. For example, you can call the procedure **sp_check_for_sync_trigger** in the body of a user-defined trigger. If **sp_check_for_sync_trigger** returns **0**, the user-defined trigger continues processing. If **sp_check_for_sync_trigger** returns **1**, the user-defined trigger exits. This ensures that the user-defined trigger does not fire when the replication trigger updates the table.
60
60
61
-
## Example
61
+
## Examples
62
+
63
+
### A. Add code to a trigger on a Subscriber table
62
64
The following example shows code that could be used in a trigger on a Subscriber table.
63
65
64
66
```
@@ -69,7 +71,7 @@ IF @retcode = 1
69
71
RETURN
70
72
```
71
73
72
-
##Example
74
+
### B. Add code to a trigger on a Publisher table
73
75
The code can also be added to a trigger on a table at the Publisher; the code is similar, but the call to **sp_check_for_sync_trigger** includes an additional parameter.
For more information, see the Microsoft ODBC documentation.
88
88
89
89
## Remarks
90
-
**sp_columns_ex** is executed by querying the COLUMNS rowset of the **IDBSchemaRowset** interface of the OLE DB provider corresponding to *table_server*. The *table_name*, *table_schema*, *table_catalog*, and *column* parameters are passed to this interface to restrict the rows returned.
90
+
-**sp_columns_ex** is executed by querying the COLUMNS rowset of the **IDBSchemaRowset** interface of the OLE DB provider corresponding to *table_server*. The *table_name*, *table_schema*, *table_catalog*, and *column* parameters are passed to this interface to restrict the rows returned.
91
91
92
-
**sp_columns_ex** returns an empty result set if the OLE DB provider of the specified linked server does not support the COLUMNS rowset of the **IDBSchemaRowset** interface.
92
+
-**sp_columns_ex** returns an empty result set if the OLE DB provider of the specified linked server does not support the COLUMNS rowset of the **IDBSchemaRowset** interface.
93
+
94
+
-**sp_columns_ex** follows the requirements for delimited identifiers. For more information, see [Database Identifiers](../../relational-databases/databases/database-identifiers.md).
93
95
94
96
## Permissions
95
97
Requires SELECT permission on the schema.
96
98
97
-
## Remarks
98
-
**sp_columns_ex** follows the requirements for delimited identifiers. For more information, see [Database Identifiers](../../relational-databases/databases/database-identifiers.md).
99
-
100
99
## Examples
101
100
The following example returns the data type of the `JobTitle` column of the `HumanResources.Employee` table in the [!INCLUDE[ssSampleDBobject](../../includes/sssampledbobject-md.md)] database on the linked server `Seattle1`.
0 commit comments