DropSubscription Method (Replication)
Applications call the DropSubscription method to drop a subscription to a SQL Server publication and optionally delete the SQL Server 2005 Compact Edition (SQL Server Compact Edition) database from the device.
Syntax
object.DropSubscription(DBDROPOPTION)
Applies To
SQL Server Compact Edition Replication object
Generic Parameters
Parameter | Description |
---|---|
DBDROPOPTION |
Specifies whether to delete or leave the SQL Server Compact Edition database |
DBDROPOPTION Parameter
DBDROPOPTION specifies whether to delete or leave the SQL Server Compact Edition database. It is optional.
Constant | Value | Description |
---|---|---|
LEAVE_DATABASE |
0 |
Deletes the replication system tables and three replication system columns in the user tables, but does not delete the database. |
DROP_DATABASE |
1 |
Deletes the SQL Server Compact Edition database (default). |
Prototype
HRESULT DropSubscription(DBDROPOPTION DBDropOption);
Returns
Return code | Description |
---|---|
S_OK |
Method succeeded. |
Any FAILED(HRESULT) |
See the SSCEErrors collection for detailed error information. |
See SSCEErrors Collection for detailed error information.
Remarks
If you use the LEAVE_DATABASE option with the DropSubscription method, all referential integrity (R/I) is removed from replicated tables and must be manually replaced if it is required.
If the SQL Server Compact Edition database is a subscriber to multiple publications, the Publisher Property (Replication), Publication Property (Replication), and PublisherDatabase Property (Replication) must be set before calling the DropSubscription method.