本主題提供了 SQL Server 變更追蹤的概觀,並描述可在 SQL Server 資料庫與 SQL Server Compact 資料庫之間執行雙向同步處理的主控台應用程式。如果伺服器是執行 SQL Server 2008,建議您使用 SQL Server 變更追蹤功能。如果伺服器執行不同的資料庫,請參閱 HOW TO:使用自訂變更追蹤系統。
如需如何執行範例程式碼的詳細資訊,請參閱同步處理 SQL Server 和 SQL Server Compact 中的<HOW-TO 主題中的範例應用程式>。了解資料衝突和錯誤在Sync Framework 資料庫提供者中,系統會在資料列層級偵測衝突和錯誤。如果在同步處理之間有一個以上的節點中變更資料列,就會產生衝突。同步處理期間發生的錯誤...
IFOBJECT_ID('Person.crud_AddressTypeInsert')ISNOTNULLBEGINDROPPROCEDUREPerson.crud_cInsertENDGOCREATEPROCEDUREPerson.crud_AddressTypeInsert ( @Name [nvarchar](50),@rowguid [uniqueidentifier],@ModifiedDate [datetime] )ASSETNOCOUNTONSETXACT_ABORTONBEGINTRANSACTIONINSERTINTOPerson.AddressType (Name,rowguid,Mo...
Before using the FILESTREAM feature you have to enable it. To this end you need to navigate toSQL Server Configuration Managerand underSQL Server Servicesright click on the SQL Server instance, select properties and in the “FileStream” tab check “Enable FILESTREAM for Transact-SQL access” and...
@saleidUNIQUEIDENTIFIEROUTPUT AS SET@saleid=NEWID() BEGINTRY INSERTINTOSales.Sales SELECT @saleid, @productid, @employeeid, @quantity ENDTRY BEGINCATCH INSERTINTOdbo.DB_Errors VALUES (SUSER_SNAME(), ERROR_NUMBER(), ERROR_STATE(), ERROR_SEVERITY(), ...
To store a BLOB using FILESTREAM feature, you must have a column of datatypeVARBINARY (MAX)along with theFILESTREAMattribute. In addition to this the table must also have aUNIQUEIDENTIFIERcolumn with theROWGUIDCOLattribute. Inserting FILESTREAM Data ...
If the row has been updated in the local database and the parameter is set to 0, the remote update is not applied. However, if the parameter is set to 1, the remote update overwrites the local update. 复制 CREATE PROCEDURE [Sales].[Customer_update] @CustomerId UniqueIdentifier, @...
`Uid`char(38)NOTNULL,PRIMARYKEY (`Uid`) ) ENGINE=InnoDBDEFAULTCHARSET=utf8; Then in order to get random UniqueIdentifier value. You can make use ofUUID()function of MySql which is similar to NEWID() of Sql Server. INSERTINTOSample(UId)VALUES(UUID());SELECT*FROMSample; ...
CREATE PROCEDURE [Sales].[Customer_update] @CustomerId UniqueIdentifier, @CustomerName NVarChar(100), @SalesPerson NVarChar(100), @CustomerType NVarChar(100), @sync_force_write Int, @sync_min_timestamp BigInt, @sync_row_count Int OUTPUT AS BEGIN UPDATE [Sales].[Customer] SET [CustomerName] ...
uniqueidentifier Let me explain this issue demonstrating simple example. --Create Table CREATE TABLE [dbo].[Student]( [Sno] [int] NOT NULL, [Student ID] nvarchar(6) Not NULL , [Student name] [varchar](50) NOT NULL, [Date of Birth] datetime not null, [Weight] [int] NULL) --Inserti...