This sample application builds a custom stored procedure resolver that executes the stored procedure at the Subscriber. It contains a sample script to set up a publication on Northwind, and install the sample resolver that calls sp_authority_resolver. sp_authority_resolver retrieves the 'authority' value from the table at the Publisher and Subscriber, and the row with the highest authority will win and be returned to the merge process to be applied to both servers. If both rows have the same authority, the source table will win. The Microsoft® Visual C++ sample code is located in the \Microsoft SQL Server\80\Tools\Devtools\Samples\sqlrepl\resolver\subspres directory.
To run the sample program
After successful build and registration, the message "DllRegisterServer in C:\Program Files\Microsoft SQL Server\80\COM\subspres.dll succeeded" is shown.
This batch:
The command prompt window provides messages as the subspres.bat file executes. The messages show that a record is being updated at the Publisher and Subscriber with the same authority, so the Publisher record wins. The next update has an authority of 9 at the Publisher and an authority of 10 at the Subscriber, so the Subscriber update wins. The last update is with the Subscriber authority set to 9 and the Publisher authority set to 10, so the Publisher wins.