Hi everyone~!,
I would like to ask some help from you guys regarding parameterized filtering for merge replication from SQL server 2005 as publisher and sql server 2005 Compact Edition as subscriber.
I search through the forum for similar problems but i still could not get it to work. I could not find more detailed solution on the web to help me solve the problem. My question are below, i really hope i can find some help here. Thank you.
1. As far as i know, the only way to specify parameterized filtering is to use SUSER_SNAME and SHOST_NAME. I do not want to use sqlserver login name for filtering, so SUSER_SNAME is already out. I also do not intent to use MachineName so again SHOST_NAME cannot be used. But from my reading, SHOST_NAME can be overwritten. Is the hostname overwrite function done in my C# application codes?
2. If i overwrite the hostname, will the machinename on that particular pc changed affecting the pc network connectivity?
3. From this article http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1070402&SiteID=1.
run the following sql inside SQL Server,
DECLARE @.publication AS sysname;
DECLARE @.article AS sysname;
SET @.publication = N'HASSystem';
SET @.article = N'Audit';
USE [HASSystem]
EXEC sp_changemergearticle
@.publication = @.publication,
@.article = @.article,
@.property = N'subset_filterclause',
@.value = N'AuditorID = CONVERT(int,HOST_NAME())',
@.force_invalidate_snapshot = 1,
@.force_reinit_subscription = 1;
GO
This was done manually in SQL server mgmt studio, right? Can i do it on my c# application on the client apps side?
Thank you everyone in advance!! I really need help on this.
Have a nice day.
Regards,
Ben
The Host_Name can be overwritten in your application code, using RMO.
The network connectivity part is unaffected.
Changing the Host_Name value via RMO only sends your specified value to the publisher, it does not change the machines actual hostname.
No comments:
Post a Comment