Showing posts with label replication. Show all posts
Showing posts with label replication. Show all posts

Wednesday, March 28, 2012

Rowguid Column Position

Hi,
We are merge replication more than 20 databases . Currently we added
one new column to a table so it will be added only in last, and now only in
this table the rowguid is not the last column.
I want to know because of this is there is any problem in replication.
Please give me a solution as soon as possible
thanks,
Soura
Soura,
the rowguid column doesn't need t be the last column, and sp_repladdcolumn
is all you need to use in this circumstance.
HTH,
Paul Ibison SQL Server MVP,
www.replicationanswers.com/default.asp
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

rowguid as Primary Key ?

If you are using replication and need a rowguid, and you need a unique
primary key for the table anyway, is there anything wrong with using the
unique rowquid for the Primary Key? If not, what are the downfalls?
Thanks,
Steve
Using rowguids for a pk is a bad choice.
Please consult http://www.aspfaq.com/show.asp?id=2504
However you can use the rowguid column as your primary key and have merge
replication use it.
Requirements are
1) call the column rowguid
2) don't use a pk, but use a unique index - really they are the same thing,
only the unique index allows a single null value.
3) give the rowguid column the ROWGUIDCOL attribute
4) give the rowguid column a newid() default
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"SteveInBeloit" <SteveInBeloit@.discussions.microsoft.com> wrote in message
news:E926325C-2B49-41C9-A7EC-71CD6A373C50@.microsoft.com...
> If you are using replication and need a rowguid, and you need a unique
> primary key for the table anyway, is there anything wrong with using the
> unique rowquid for the Primary Key? If not, what are the downfalls?
> Thanks,
> Steve

rowguid ?

Hi,
I tried to make a replication between two databases, a merge
replication...
But at the end, when the replication agents started, I found lots of errors
that tells me
that it don't knows who is the column 'rowguid'. This column was added only
on the publisher.
Can somebosy tell me what is wrong? what is the right solution?
Thank you in advance,
Alex
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
".:alex:." <alex_77ro@.yahoo.com> wrote in message
news:Of2SSEjgFHA.2896@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I tried to make a replication between two databases, a merge
> replication...
> But at the end, when the replication agents started, I found lots of
errors
> that tells me
> that it don't knows who is the column 'rowguid'. This column was added
only
> on the publisher.
> Can somebosy tell me what is wrong? what is the right solution?
> Thank you in advance,
> Alex
>
>
|||your's book title is:
"A Guide to SQL Server 2000 Transactional and Snapshot Replication"
but I need info about merge replication. In fact a little help, I no need to
learn the replication mechanism , etc... because isn't my job. I need a
little info
like I found here:
http://www.databasejournal.com/featu...le.php/1438231
Thank you for your attention,
Alex
PS: I'm mechanical engineering too ;)
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:OFeQ5WjgFHA.1252@.TK2MSFTNGP09.phx.gbl...
>
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> ".:alex:." <alex_77ro@.yahoo.com> wrote in message
> news:Of2SSEjgFHA.2896@.TK2MSFTNGP09.phx.gbl...
> errors
> only
>
|||Can you post the error number, and possibly the exact message.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:OFeQ5WjgFHA.1252@.TK2MSFTNGP09.phx.gbl...
>
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> ".:alex:." <alex_77ro@.yahoo.com> wrote in message
> news:Of2SSEjgFHA.2896@.TK2MSFTNGP09.phx.gbl...
> errors
> only
>
|||I don't know a number or the exact message, because I disabled the
publisher and I cannot reproduce the scenario from my station (in this case
the test computer) because I cannot start de SQLServerAgent.
I will research ...
Thank you anyway
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:OMiaskjgFHA.1948@.TK2MSFTNGP12.phx.gbl...
> Can you post the error number, and possibly the exact message.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:OFeQ5WjgFHA.1252@.TK2MSFTNGP09.phx.gbl...
>
sql

Rowguid - index in system table

Hi,
I am dealing with merge replication.
The missing statistics event points out [MSmerge_tombstone].[rowguid] in all
our databases. Noticed that no specific index for rowguid created in
[MSmerge_tombstone] table specific on this column.
We would like to know why there is no index created on this column.Do we
need to manually create this index?
Does this missing statistics is an indication of potential problem. If so
what could be the corrective action(s) ?
Thanks,
Soura
indexes are only used if the table is greater than 100 pages. This means
that if more than 1500 rows exist in your tombstone table it would benefit
for queries which are done on the rowguid column alone.
The most significant column in the queries is the generation column and also
on the tablenick and rowguid columns. There are indexes on these columns.
Which queries/procs are complaining about the missing statistics? Does
autocreate and auto update statistics help with the performance of this
database?
Also note that by default the metadata tables are cleaned up each time the
merge agent runs so they should be small.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"SouRa" <SouRa@.discussions.microsoft.com> wrote in message
news:16760881-928B-4137-A542-D430C97ACC78@.microsoft.com...
> Hi,
> I am dealing with merge replication.
> The missing statistics event points out [MSmerge_tombstone].[rowguid] in
> all
> our databases. Noticed that no specific index for rowguid created in
> [MSmerge_tombstone] table specific on this column.
> We would like to know why there is no index created on this column.Do we
> need to manually create this index?
> Does this missing statistics is an indication of potential problem. If so
> what could be the corrective action(s) ?
> Thanks,
> Soura

rowguid

Hello,
When I use the Replication and the Publication mechanism - why is created
for every table which I want to synchronize an additional column with the
name rowguid? I have already set a primary key for all tables which I want to
synchronize.
Regards
mat
the rowguid is used to track which row has been modified in a database. By
examining the guid the merge agent knows what table it belongs too, and can
track its change history.
Hilary Cotter
Looking for a SQL Server replication book?
Now available for purchase at:
http://www.nwsu.com/0974973602.html
"mathon" <mathon@.discussions.microsoft.com> wrote in message
news:2D7CC7C9-8925-4BED-8DCB-9DF24CE88512@.microsoft.com...
> Hello,
> When I use the Replication and the Publication mechanism - why is created
> for every table which I want to synchronize an additional column with the
> name rowguid? I have already set a primary key for all tables which I want
> to
> synchronize.
> Regards
> mat

rowguid

After replication done, both source database and subscription database have
a extra column--rowguid.
SQL server did not clean them up.
Should I clean then one table by one table manually or there is a was to
clean them up.
Thanks
After replication done, both source database and subscription database have
a extra column--rowguid.
SQL server did not clean them up.
I delete the publication. but the column rowguid still there
Do I have to clean them one table by one table manually or there is a way
to
clean them up.
Thanks
|||This is quite normal behaviour. It may be that a (DBA) user's application
relies on these columns in some way, so it is left up to the user to remove
them. There are no inbuilt stored procs to remove these columns, but
creating yourself a script shouldn't be too difficult - syscolumns and
sysobjects are the tables you'll need. If it's just a cast of a couple of
tables I'd do it manually, but if not or if you want more of a challenge,
have a go at the script and post back if you can't do it and I'll create one
for you.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||I have hundreds tables.
It will appreciate very much if you can post a sample script for this.
Thanks
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:ug15GiVvFHA.720@.TK2MSFTNGP15.phx.gbl...
> This is quite normal behaviour. It may be that a (DBA) user's application
> relies on these columns in some way, so it is left up to the user to
remove
> them. There are no inbuilt stored procs to remove these columns, but
> creating yourself a script shouldn't be too difficult - syscolumns and
> sysobjects are the tables you'll need. If it's just a cast of a couple of
> tables I'd do it manually, but if not or if you want more of a challenge,
> have a go at the script and post back if you can't do it and I'll create
one
> for you.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>
|||Chen,
I'll post it up tomorrow - what type of replication are you using?
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Thanks.
I did merge replication and I deleted the publication days ago.
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:eGxuc$VvFHA.2076@.TK2MSFTNGP14.phx.gbl...
> Chen,
> I'll post it up tomorrow - what type of replication are you using?
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>
>
>
|||Chen,
run each of these in turn and then run the output (backup your database
first )
-- drop rowguid indexes
select 'drop index ' + sysobjects.name + '.' + sysindexes.name from
sysindexes
inner join sysobjects
on sysindexes.id = sysobjects.id
where objectproperty(object_id(sysobjects.name),'IsMSShi pped') = 0
and sysindexes.indid > 0 and sysindexes.indid < 255 and (sysindexes.status &
64)=0
and index_col(sysobjects.name, sysindexes.indid, 1) = 'rowguid'
order by sysindexes.indid
-- remove rowguid default constraints
select 'alter table ' + b.name + ' drop constraint ' + a.name from
sysobjects a
inner join syscolumns on syscolumns.id = a.parent_obj
inner join sysobjects b on syscolumns.id = b.id
where syscolumns.name = 'rowguid'
and objectproperty(object_id(b.name),'IsMSShipped') = 0
and a.xtype = 'D'
-- remove rowguid columns
select 'alter table ' + sysobjects.name + ' drop column ''rowguid'' ' from
syscolumns
inner join sysobjects on syscolumns.id = sysobjects.id
where syscolumns.name = 'rowguid'
and objectproperty(object_id(sysobjects.name),'IsMSShi pped') = 0
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Thanks
Chen
"Paul Ibison" wrote:

> Chen,
> run each of these in turn and then run the output (backup your database
> first )
> -- drop rowguid indexes
> select 'drop index ' + sysobjects.name + '.' + sysindexes.name from
> sysindexes
> inner join sysobjects
> on sysindexes.id = sysobjects.id
> where objectproperty(object_id(sysobjects.name),'IsMSShi pped') = 0
> and sysindexes.indid > 0 and sysindexes.indid < 255 and (sysindexes.status &
> 64)=0
> and index_col(sysobjects.name, sysindexes.indid, 1) = 'rowguid'
> order by sysindexes.indid
> -- remove rowguid default constraints
> select 'alter table ' + b.name + ' drop constraint ' + a.name from
> sysobjects a
> inner join syscolumns on syscolumns.id = a.parent_obj
> inner join sysobjects b on syscolumns.id = b.id
> where syscolumns.name = 'rowguid'
> and objectproperty(object_id(b.name),'IsMSShipped') = 0
> and a.xtype = 'D'
> -- remove rowguid columns
> select 'alter table ' + sysobjects.name + ' drop column ''rowguid'' ' from
> syscolumns
> inner join sysobjects on syscolumns.id = sysobjects.id
> where syscolumns.name = 'rowguid'
> and objectproperty(object_id(sysobjects.name),'IsMSShi pped') = 0
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>

Friday, March 23, 2012

Row versioning in SQL 2000?

I replicate (transactional replication) my data entry database to a
read-only database. Both are SQL 2000+SP4. The web server reads the
read-only database. At times, there will be lots of changes in the data
entry database, thus lots of replications to the read-only database. I
am concerned that the replication may lock the data in the read-only
database, causing slow response to the web server.

I would like to use row versioning so that the read-only database can
supply old data when the same row is being written by replication. I
read that row versioning is a feature in SQL 2005. Is there any
versioning capability in SQL 2000?

Thanks(betbubble@.gmail.com) writes:

Quote:

Originally Posted by

I replicate (transactional replication) my data entry database to a
read-only database. Both are SQL 2000+SP4. The web server reads the
read-only database. At times, there will be lots of changes in the data
entry database, thus lots of replications to the read-only database. I
am concerned that the replication may lock the data in the read-only
database, causing slow response to the web server.
>
I would like to use row versioning so that the read-only database can
supply old data when the same row is being written by replication. I
read that row versioning is a feature in SQL 2005. Is there any
versioning capability in SQL 2000?


No.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Monday, March 12, 2012

Row Guid

I thought I read that 2000 transactional replication used a ROW Guid on the
subscriber. But I just looked at the test instance I set up and I see no
such thing. If Sql Server does not use a RowGuid, how does it keep track of
everything? just by the primary key?
Trans replication doesn't use rowguid. Only Merge uses it. Trans, (immediate
and queued) use ms_repl_tran_version) to keeep track. If it's only a one way
transactional, it doesn't use anything because it doesn't need to.
|||It uses the rowguid key if you are using immediate updating, immediate
updating with queued failover, or queued.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"CLM" <CLM@.discussions.microsoft.com> wrote in message
news:5C0574FB-C9CA-4990-98FD-232FB196D33E@.microsoft.com...
>I thought I read that 2000 transactional replication used a ROW Guid on the
> subscriber. But I just looked at the test instance I set up and I see no
> such thing. If Sql Server does not use a RowGuid, how does it keep track
> of
> everything? just by the primary key?

Row filtering - Comparing HOST_NAME() with uniqueidentifier

Working with Merge Replication between SQL Server 2000 and SQL Server
CE 2.0.
I was doing some filtering on the Publication with "host_name()"
function. I was comparing host_name() function with a nvarchar column,
so all was working pretty well.
In order to filter all appointments for a specific patient, I was
trying to assign the HostName property of the replication object with
patientId. This patientId is a uniqueidentifier column, therefore, when
building the where clause condition in the Publication's properties
(patientId = HOST_NAME()), I got an error saying that cannot compare
varchar with uniqueidentifier.
Any solution to this? I think I should compare the uniqueidentifier
column rather than adding another nvarchar column
(patientId2)containing same value as patientId original column?
Besides: I need a patient only can see his/her appointments, but that a
doctor can see all appointments from all his patients. Appointment
table contains doctorId and a patientId fields, which both have
uniqueidentifier datatype.
What should be the best filter for this case? Would I need another
publication or a gool filter would done it?
Thanks in advance.
have a look at fn_varbintohexstr.
For the second one it sounds like you need a second publication where you
filter on the doctorID.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1128333296.020256.272540@.g44g2000cwa.googlegr oups.com...
> Working with Merge Replication between SQL Server 2000 and SQL Server
> CE 2.0.
> I was doing some filtering on the Publication with "host_name()"
> function. I was comparing host_name() function with a nvarchar column,
> so all was working pretty well.
> In order to filter all appointments for a specific patient, I was
> trying to assign the HostName property of the replication object with
> patientId. This patientId is a uniqueidentifier column, therefore, when
> building the where clause condition in the Publication's properties
> (patientId = HOST_NAME()), I got an error saying that cannot compare
> varchar with uniqueidentifier.
> Any solution to this? I think I should compare the uniqueidentifier
> column rather than adding another nvarchar column
> (patientId2)containing same value as patientId original column?
> Besides: I need a patient only can see his/her appointments, but that a
> doctor can see all appointments from all his patients. Appointment
> table contains doctorId and a patientId fields, which both have
> uniqueidentifier datatype.
> What should be the best filter for this case? Would I need another
> publication or a gool filter would done it?
> Thanks in advance.
>
|||Thanks Hilary.
I'll take a look at that function.
Respecting to my second request, my initial idea was to only have one
publication for all the application instead of having several and
having to mantain them. Does it worth or is the normal approach to have
more than one publication? Isn't there another way of achieving what
I'm looking for? I would prefer to have only one publication, but if
there is not another way.......
Regards.
|||I would go for multiple publications. There is more administrative effort,
but slight.
You might be able to get away with a more complex filter, is something along
the line of
<> where PatientID in (select patientID from patients where something = case
when HOST_NAME() > 'M' then (select doctorID from doctors) else
host_name()end )
So you could build an elaborate case statement and do existence checks with
subqueries, or even use UDF's, but you are limited by what you can do on the
host end which is CE, and then there will be a performance hit while this
where condition is evaluated.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1128341002.180658.194500@.g43g2000cwa.googlegr oups.com...
> Thanks Hilary.
> I'll take a look at that function.
> Respecting to my second request, my initial idea was to only have one
> publication for all the application instead of having several and
> having to mantain them. Does it worth or is the normal approach to have
> more than one publication? Isn't there another way of achieving what
> I'm looking for? I would prefer to have only one publication, but if
> there is not another way.......
> Regards.
>
|||I see your example too complex to build. Besides, I'm not sure I
understand your "where clause" example. What about when HOST_NAME() >
'M' ? Sorry but I don't understand it at all. Could you give me a
little more detailed example, with pseudo-code or something similar
please?
You mean you can elaborate case statements in the Publication's where
clause? And can I include subqueries and so on?
I understand UDF's are difficult when working against SQL Server CE,
aren't they?
I cannot achieve to convert host_name() to uniqueidentifier.
Publication's property page tells me cannot do that. Any example?
The alternative of RDA would be useful in this case?
Sorry to ask you for all kind of examples Hilary but I've never
experienced with Merge Replication before?
|||Hi again Hilary, I've achieved what I was looking for with the row
filtering I show you below. Don't know if it's good for performance or
not, but works great and I think meets my requirements. Anyway, any
opinion or new idea will be greatly appreciated:
SELECT <columnas_publicadas> FROM [dbo].[Appointment] WHERE
patientId in
(select patientId from Patient where patientFirstName = HOST_NAME())
or doctorId in
(select doctorId from Doctor where doctorFirstName = HOST_NAME())
This is a non-real "where clause", because it's not very useful to
filter rows based on the first name of the patient or doctor. Anyway,
in this case, I fill the Replication object's HostName property with
patient's or doctor's first name and the "OR" clause works great for
me! I understand that when patientId is not found, doctorId is checked.
If patientId is found, doctorId is not checked anymore.
I now would like to achieve the same with uniqueidentifiers but I'm not
able.
Is it better to have two publications for this case, or with this "OR
where clause" would be enough?
Thanks very much. I'm willing for any reply or advice.
|||basically its something bogus, but something I use every once and a while.
Host_name() >'m' compares this first value of host_name and checks to see if
its ascii value is greater than the ascii value of m.
so a host_name of 'alpha' would not meet this filtering criteria, whereas a
host_name of 'nancy' would. You can override the host_name() value by using
the -HostName parameter in your command string.
I can't really elaborate on the possible where clause or a case statement as
I don't know your schema. It looks like you are filtering on patients by
patientID. Note that you could issue a subquery if you have a doctor's table
of if the patients table is related to the doctor table via dri and you
extend the join filter it should work automatically.
I was hoping you would look at what I had written and go ah ha!
Can you post the schema of the doctors/patients tables?
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1128343662.941267.220180@.f14g2000cwb.googlegr oups.com...
> I see your example too complex to build. Besides, I'm not sure I
> understand your "where clause" example. What about when HOST_NAME() >
> 'M' ? Sorry but I don't understand it at all. Could you give me a
> little more detailed example, with pseudo-code or something similar
> please?
> You mean you can elaborate case statements in the Publication's where
> clause? And can I include subqueries and so on?
> I understand UDF's are difficult when working against SQL Server CE,
> aren't they?
> I cannot achieve to convert host_name() to uniqueidentifier.
> Publication's property page tells me cannot do that. Any example?
> The alternative of RDA would be useful in this case?
> Sorry to ask you for all kind of examples Hilary but I've never
> experienced with Merge Replication before?
>
|||I don't know if you've read my last post. I suppose yes. I've achieved
this way, with a where clause containing an OR:
SELECT <columnas_publicadas> FROM [dbo].[Appointment] WHERE
patientId in
(select patientId from Patient where patientFirstName = HOST_NAME())
or doctorId in
(select doctorId from Doctor where doctorFirstName = HOST_NAME())
I understand you don't agree with this approach at all but as I've
already told you, I want to avoid having more tha one publication. How
do you see it?
My database schema goes as follows:
Table Patient: patientId (uniqueidentifier -PK), patientFirstName, etc.
Table Doctor: doctorId (uniqueidentifier -PK), doctorFirstName, etc.
Relation table - Table DoctorPatient: patientId (part of PK), doctorId
(part of PK), diseaseId(part of PK), rowguidcol (generated by the
Publication) and so on.
Note that a patient can have same doctor for different diseases. For
example: Patient A is attended by Doctor B for disease C, and Patient A
is also attented by Doctor B, this time for disease D.
Anyway, I cannot filter directly by GUID, that is, I cannot convert
host_name() to GUID!
Help me please!
I hope to have explained myself correctly enough. Really thanks for
your time Hilary.Regards.
|||Hi again Hilary,
My "final" where clause would be as follows:
SELECT <columnas_publicadas> FROM [dbo].[Appointment] WHERE
HOST_NAME() = convert(nvarchar(100), patientId) or HOST_NAME()
= convert(nvarchar(100), doctorId) and isClosed = 0
You can notice that I am now able to do the comparison between
uniqueidentifier and nvarchar. I thougth this comparison had to be done
in the other direction, but found this and worked. Would be better to
convert host_name() to uniqueidentifier or left it this way?
I've also noticed that this where clause consumes additional time. I
didn't expect, but this way the first replication delays in some
seconds respect an initial replication wihout where clauses. Is this
normal? Could be because I now haven't got many rows while this
attempts are being done?
Give me some feedback please. Regards.
|||This looks ok. I think you would be better off adding an int column to the
doctor and patient tables. Add the identity property to these columns, put
an index on them and then use these in your join condition. It will be more
efficient this way.
Other than that try to put an index on the unique identifier column to speed
up the queries.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1128433459.393363.244450@.g14g2000cwa.googlegr oups.com...
> Hi again Hilary,
> My "final" where clause would be as follows:
> SELECT <columnas_publicadas> FROM [dbo].[Appointment] WHERE
> HOST_NAME() = convert(nvarchar(100), patientId) or HOST_NAME()
> = convert(nvarchar(100), doctorId) and isClosed = 0
> You can notice that I am now able to do the comparison between
> uniqueidentifier and nvarchar. I thougth this comparison had to be done
> in the other direction, but found this and worked. Would be better to
> convert host_name() to uniqueidentifier or left it this way?
> I've also noticed that this where clause consumes additional time. I
> didn't expect, but this way the first replication delays in some
> seconds respect an initial replication wihout where clauses. Is this
> normal? Could be because I now haven't got many rows while this
> attempts are being done?
> Give me some feedback please. Regards.
>

Row filtering

Hi to all
Having an issue with replication which I hope someone can help with.
Here is a summary of the processes involved.
VB application updates, deletes and inserts into a database (DB1) on our LAN
every minute.
DB1 is replicated to our website (lets call this Website1) on a
transactional basis.
We have recently built a new website (lets call this Website2) which runs on
a database structure (DB2) identical to Website1, however the data needed to
be held in Website2 is only a small subset of the data compared to Website1.
We decided to replicate to Website2, using row filtering. We created a new
publication from DB1, set up row filtering to only replicate data which was
less than a week old according to a field which determines the records age,
on a transactional basis. We created the snapshot and applied it to DB2 with
no issues however, shortly after this, an error is returned which indicates
the subscriber is trying to remove a record which does not exist in DB2 "row
not found at subscriber" The last command the agent is trying to run looks
like this
CALL sp_MSdel_Adverts ({64DFEE13-BFFA-4383-90DC-C1AF5A906F95})
This unique identifier does not exist as a record at the subscriber but does
exist as a record at the publisher.
There are no processes which are updating/removing records from DB2, it is
purely designed for reads only.
Any assistance would be greatly appreciated.
Regards
Andy Hayes
something looks a little odd here. First off is this a single column
table you are replicating? It looks like it. Secondly it looks like you
are using guids as pks - this is seldom a good idea.
Thirdly how did you synchronize your two databases? through a snapshot?
Is so, sql server guarantees synchronization. Can you run a validation
to determine is your databases are in sync.
Andy Hayes wrote:
> Hi to all
> Having an issue with replication which I hope someone can help with.
> Here is a summary of the processes involved.
> VB application updates, deletes and inserts into a database (DB1) on
our LAN
> every minute.
> DB1 is replicated to our website (lets call this Website1) on a
> transactional basis.
> We have recently built a new website (lets call this Website2) which
runs on
> a database structure (DB2) identical to Website1, however the data
needed to
> be held in Website2 is only a small subset of the data compared to
Website1.
> We decided to replicate to Website2, using row filtering. We created
a new
> publication from DB1, set up row filtering to only replicate data
which was
> less than a week old according to a field which determines the
records age,
> on a transactional basis. We created the snapshot and applied it to
DB2 with
> no issues however, shortly after this, an error is returned which
indicates
> the subscriber is trying to remove a record which does not exist in
DB2 "row
> not found at subscriber" The last command the agent is trying to run
looks
> like this
> CALL sp_MSdel_Adverts ({64DFEE13-BFFA-4383-90DC-C1AF5A906F95})
> This unique identifier does not exist as a record at the subscriber
but does
> exist as a record at the publisher.
> There are no processes which are updating/removing records from DB2,
it is
> purely designed for reads only.
> Any assistance would be greatly appreciated.
> Regards
> Andy Hayes
|||Hi Hilary
Thanks for your response.
The table is not single column it has multiple columns. You are correct that
the guid is a primary key.
The databases are syncronised via the snapshot. If I query the subscriber
based on the row filter query, I am returned the same number of records that
exist which meet that criteria at the publisher. The two are in sync as soon
as the snapshot has been applied.
Andy
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:1113990675.177808.271030@.o13g2000cwo.googlegr oups.com...
> something looks a little odd here. First off is this a single column
> table you are replicating? It looks like it. Secondly it looks like you
> are using guids as pks - this is seldom a good idea.
> Thirdly how did you synchronize your two databases? through a snapshot?
> Is so, sql server guarantees synchronization. Can you run a validation
> to determine is your databases are in sync.
>
> Andy Hayes wrote:
> our LAN
> runs on
> needed to
> Website1.
> a new
> which was
> records age,
> DB2 with
> indicates
> DB2 "row
> looks
> but does
> it is
>
|||Its unlikely that a replication process has caused this. There are
situations where if you are using the continue on data consistency profile
where you might get this lack of synchronization.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Andy Hayes" <andyh@.friday-ad.co.uk> wrote in message
news:%23jka$HZRFHA.996@.TK2MSFTNGP09.phx.gbl...
> Hi Hilary
> Thanks for your response.
> The table is not single column it has multiple columns. You are correct
> that the guid is a primary key.
> The databases are syncronised via the snapshot. If I query the subscriber
> based on the row filter query, I am returned the same number of records
> that exist which meet that criteria at the publisher. The two are in sync
> as soon as the snapshot has been applied.
> Andy
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:1113990675.177808.271030@.o13g2000cwo.googlegr oups.com...
>

Row filter vs join filter

Hi,
I am new to replication, I am confusing with row filter and join filter. If
I only use row filter, does the SQL server replication caused any data
integrity problem? e.g. simple relationship of such table tblCustomer,
tblOrder and tblOrderDetail?
Thank you.
HKM
a row filter normally means you filter by a column on a row with a value.
Ie in the authors table a row filter would look like this
where state='ca'
When you do a join filter you are joining on another table for your
filtering criteria.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"HKM" <HKM@.discussions.microsoft.com> wrote in message
news:F05A0678-7A6B-49F3-82D0-0C4EA60AB0D4@.microsoft.com...
> Hi,
> I am new to replication, I am confusing with row filter and join filter.
If
> I only use row filter, does the SQL server replication caused any data
> integrity problem? e.g. simple relationship of such table tblCustomer,
> tblOrder and tblOrderDetail?
> Thank you.
> HKM

Row Filter not working

I have a snapshot/transactional replication publication with the following
row filter:
SELECT <published_columns> FROM <<TABLE>> WHERE ItemName
not in ('dbsvrip','otfrconn','mapdir') and AppTypeID<>7
The snapshot generated just fine, but now none of the changes to the table
are getting replicated.
I'm using sql2000.
Any ideas?
I resolved this problem by changing the WHERE CLAUSE to:
Itemname<>'dbsvrip' and Itemname<>'otfrconn' and Itemname<>'mapdir' and
AppTypeID<>7.
"Need more Zzzz" wrote:

> I have a snapshot/transactional replication publication with the following
> row filter:
> SELECT <published_columns> FROM <<TABLE>> WHERE ItemName
> not in ('dbsvrip','otfrconn','mapdir') and AppTypeID<>7
> The snapshot generated just fine, but now none of the changes to the table
> are getting replicated.
> I'm using sql2000.
> Any ideas?
>

Row filter

i got a really strange problem.
i am doing replication DB from SQL to PDA with CE2.0, there are about 30
articles in publication, and one of them is call product table. it works fine
when i add product table without row filter. the problem is when i add a
row filter in Product table , it occur error call "run".
product table has one primary key with identity.
so anyone know what's going on here?
cheers
nick
I understood that the problem is strange... But I can not say that I
understood what kind of error are you getting... Could you provide more info
on the error ?
Regards,
Kestutis Adomavicius
Consultant
UAB "Baltic Software Solutions"
"Nick" <Nick@.discussions.microsoft.com> wrote in message
news:BDB59813-A018-40B5-8894-26FD281F6831@.microsoft.com...
> i got a really strange problem.
> i am doing replication DB from SQL to PDA with CE2.0, there are about 30
> articles in publication, and one of them is call product table. it works
fine
> when i add product table without row filter. the problem is when i add
a
> row filter in Product table , it occur error call "run".
> product table has one primary key with identity.
> so anyone know what's going on here?
> cheers
> nick
>
|||could you script out your publication, schema, and post it here along with
the exact error message you are getting?
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Nick" <Nick@.discussions.microsoft.com> wrote in message
news:BDB59813-A018-40B5-8894-26FD281F6831@.microsoft.com...
> i got a really strange problem.
> i am doing replication DB from SQL to PDA with CE2.0, there are about 30
> articles in publication, and one of them is call product table. it works
fine
> when i add product table without row filter. the problem is when i add
a
> row filter in Product table , it occur error call "run".
> product table has one primary key with identity.
> so anyone know what's going on here?
> cheers
> nick
>
|||i fixed this problem by tick the force relationship to replication option in
this table's relation property.
thanks all
nick

row filter

HI all
I am using merge replication for mobile. the publication has 39 table
and one of talbe call products, my pocket pc can down snapshot database
sucessfully when product table without row filter. it always occurs
"run" error if i set a row filter (product.productInactive=0) in products
table.
Below is script......please sb can help me out here, i been stuck here
for a week.
Thanks
/****** Begin: Script to be run at Distributor: NICK ******/
/****** Installing the server Nick as a Distributor. Script Date: 2/23/2005
1:26:58 PM ******/
use master
GO
exec sp_adddistributor @.distributor = N'EBREATHEDEMO', @.password = N''
GO
-- Updating the agent profile defaults
sp_MSupdate_agenttype_default @.profile_id = 1
GO
sp_MSupdate_agenttype_default @.profile_id = 2
GO
sp_MSupdate_agenttype_default @.profile_id = 4
GO
sp_MSupdate_agenttype_default @.profile_id = 6
GO
sp_MSupdate_agenttype_default @.profile_id = 11
GO
-- Adding the distribution database
exec sp_adddistributiondb @.database = N'MSALES_Distribution', @.data_folder
= N'C:\Program Files\Microsoft SQL Server\MSSQL\Data', @.data_file =
N'MSALES_Distribution.MDF', @.data_file_size = 2, @.log_folder = N'C:\Program
Files\Microsoft SQL Server\MSSQL\Data', @.log_file =
N'MSALES_Distribution.LDF', @.log_file_size = 0, @.min_distretention = 0,
@.max_distretention = 1, @.history_retention = 48, @.security_mode = 1
GO
-- Adding the distribution publisher
exec sp_adddistpublisher @.publisher = N'EBREATHEDEMO', @.distribution_db =
N'MSALES_Distribution', @.security_mode = 1, @.working_directory =
N'\\EBREATHEDEMO\C$\Program Files\Microsoft SQL Server\MSSQL\ReplData',
@.trusted = N'false', @.thirdparty_flag = 0
GO
/****** End: Script to be run at Distributor: NICK ******/
/****** Begin: Script to be run at Publisher: NICK ******/
-- Enabling the replication database
use master
GO
exec sp_replicationdboption @.dbname = N'MSALES', @.optname = N'merge
publish', @.value = N'true'
GO
use [MSALES]
GO
-- Adding the merge publication
exec sp_addmergepublication @.publication = N'MSALES_Publication',
@.description = N'Merge publication of MSALES database from Publisher
EBREATHEDEMO.', @.retention = 14, @.sync_mode = N'character', @.allow_push =
N'true', @.allow_pull = N'true', @.allow_anonymous = N'true',
@.enabled_for_internet = N'false', @.centralized_conflicts = N'true',
@.dynamic_filters = N'true', @.snapshot_in_defaultfolder = N'true',
@.compress_snapshot = N'false', @.ftp_port = 21, @.ftp_login = N'anonymous',
@.conflict_retention = 14, @.keep_partition_changes = N'true',
@.allow_subscription_copy = N'false', @.allow_synctoalternate = N'false',
@.validate_subscriber_info = N'HOST_NAME()', @.add_to_active_directory =
N'false', @.max_concurrent_merge = 0, @.max_concurrent_dynamic_snapshots = 0
exec sp_addpublication_snapshot @.publication =
N'MSALES_Publication',@.frequency_type = 4, @.frequency_interval = 1,
@.frequency_relative_interval = 1, @.frequency_recurrence_factor = 0,
@.frequency_subday = 1, @.frequency_subday_interval = 5, @.active_start_date =
0, @.active_end_date = 0, @.active_start_time_of_day = 500,
@.active_end_time_of_day = 235959, @.snapshot_job_name =
N'EBREATHEDEMO-MSALES-MSALES_Publication-1'
GO
exec sp_grant_publication_access @.publication = N'MSALES_Publication',
@.login = N'BUILTIN\Administrators'
GO
exec sp_grant_publication_access @.publication = N'MSALES_Publication',
@.login = N'distributor_admin'
GO
exec sp_grant_publication_access @.publication = N'MSALES_Publication',
@.login = N'eBreathe'
GO
-- Adding the merge articles
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'QALockedProduct', @.source_owner = N'dbo', @.source_object =
N'QALockedProduct', @.type = N'table', @.description = null, @.column_tracking
= N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'CustomerDistributor', @.source_owner = N'dbo', @.source_object =
N'CustomerDistributor', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'BonusDealFlavour', @.source_owner = N'dbo', @.source_object =
N'BonusDealFlavour', @.type = N'table', @.description = null, @.column_tracking
= N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'DistributorProductFlavour', @.source_owner = N'dbo', @.source_object =
N'DistributorProductFlavour', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'QAMaximumFlavour', @.source_owner = N'dbo', @.source_object =
N'QAMaximumFlavour', @.type = N'table', @.description = null, @.column_tracking
= N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = N'(CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10))
>= BeginDate) AND (CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10)) <=
EndDate)', @.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'BonusDealState', @.source_owner = N'dbo', @.source_object =
N'BonusDealState', @.type = N'table', @.description = null, @.column_tracking =
N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'BonusDealProductState', @.source_owner = N'dbo', @.source_object =
N'BonusDealProductState', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'CustomerContact', @.source_owner = N'dbo', @.source_object =
N'CustomerContact', @.type = N'table', @.description = null, @.column_tracking
= N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'QALockedType', @.source_owner = N'dbo', @.source_object = N'QALockedType',
@.type = N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause =
N'(CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10)) >= BeginDate) AND
(CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10)) <= EndDate)',
@.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'QAMaximumProductDetail', @.source_owner = N'dbo', @.source_object =
N'QAMaximumProductDetail', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'BonusDealProductCondition', @.source_owner = N'dbo', @.source_object =
N'BonusDealProductCondition', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'BonusDealCondition', @.source_owner = N'dbo', @.source_object =
N'BonusDealCondition', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'ProductFlavour', @.source_owner = N'dbo', @.source_object =
N'ProductFlavour', @.type = N'table', @.description = null, @.column_tracking =
N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = N'ProductFlavourInactive=0', @.vertical_partition =
N'false', @.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'ProductGroupBannerDistributorState', @.source_owner = N'dbo',
@.source_object = N'ProductGroupBannerDistributorState', @.type = N'table',
@.description = null, @.column_tracking = N'true', @.pre_creation_cmd =
N'drop', @.creation_script = null, @.schema_option = 0x000000000000CFF1,
@.article_resolver = null, @.subset_filterclause = null, @.vertical_partition =
N'false', @.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'BonusDealProductFlavourGiveOut', @.source_owner = N'dbo', @.source_object =
N'BonusDealProductFlavourGiveOut', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'BonusDealFlavourGiveOut', @.source_owner = N'dbo', @.source_object =
N'BonusDealFlavourGiveOut', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'QALockedBanner', @.source_owner = N'dbo', @.source_object =
N'QALockedBanner', @.type = N'table', @.description = null, @.column_tracking =
N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'Customers', @.source_owner = N'dbo', @.source_object = N'Customers', @.type =
N'table', @.description = null, @.column_tracking = N'true', @.pre_creation_cmd
= N'drop', @.creation_script = null, @.schema_option = 0x000000000000CFF1,
@.article_resolver = null, @.subset_filterclause =
N'(Customers.CustomerInactive=0)AND (CAST(RepCode AS
NVARCHAR)=HOST_NAME())', @.vertical_partition = N'false', @.destination_owner
= N'dbo', @.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'QAMaximumProduct', @.source_owner = N'dbo', @.source_object =
N'QAMaximumProduct', @.type = N'table', @.description = null, @.column_tracking
= N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = N'(CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10))
>= BeginDate) AND (CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10)) <=
EndDate)', @.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'BonusDealProduct', @.source_owner = N'dbo', @.source_object =
N'BonusDealProduct', @.type = N'table', @.description = null, @.column_tracking
= N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = N'(CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10))
>= BeginDate) AND (CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10)) <=
EndDate)', @.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'BonusDeal', @.source_owner = N'dbo', @.source_object = N'BonusDeal', @.type =
N'table', @.description = null, @.column_tracking = N'true', @.pre_creation_cmd
= N'drop', @.creation_script = null, @.schema_option = 0x000000000000CFF1,
@.article_resolver = null, @.subset_filterclause =
N'(CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10)) >= BeginDate) AND
(CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10)) <= EndDate)',
@.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
--exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'Users', @.source_owner = N'dbo', @.source_object = N'Users', @.type =
N'table', @.description = null, @.column_tracking = N'true', @.pre_creation_cmd
= N'drop', @.creation_script = null, @.schema_option = 0x000000000000CFF1,
@.article_resolver = null, @.subset_filterclause = N'CAST(RepCode AS
NVARCHAR)=HOST_NAME()', @.vertical_partition = N'false', @.destination_owner =
N'dbo', @.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
--GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'DistributorWarehouse', @.source_owner = N'dbo', @.source_object =
N'DistributorWarehouse', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'QALocked', @.source_owner = N'dbo', @.source_object = N'QALocked', @.type =
N'table', @.description = null, @.column_tracking = N'true', @.pre_creation_cmd
= N'drop', @.creation_script = null, @.schema_option = 0x000000000000CFF1,
@.article_resolver = null, @.subset_filterclause = null, @.vertical_partition =
N'false', @.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'Products', @.source_owner = N'dbo', @.source_object = N'Products', @.type =
N'table', @.description = null, @.column_tracking = N'true', @.pre_creation_cmd
= N'drop', @.creation_script = null, @.schema_option = 0x000000000000CFF1,
@.article_resolver = null, @.subset_filterclause =
N'Products.ProductInactive=0', @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'DistributorState', @.source_owner = N'dbo', @.source_object =
N'DistributorState', @.type = N'table', @.description = null, @.column_tracking
= N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'SpecialState', @.source_owner = N'dbo', @.source_object = N'SpecialState',
@.type = N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause =
N'(CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10)) >= SpecialBeginDate) AND
(CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10)) <= SpecialEndDate)',
@.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'Flavours', @.source_owner = N'dbo', @.source_object = N'Flavours', @.type =
N'table', @.description = null, @.column_tracking = N'true', @.pre_creation_cmd
= N'drop', @.creation_script = null, @.schema_option = 0x000000000000CFF1,
@.article_resolver = null, @.subset_filterclause = null, @.vertical_partition =
N'false', @.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'BannerGroups', @.source_owner = N'dbo', @.source_object = N'BannerGroups',
@.type = N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause = null,
@.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'CreditReason', @.source_owner = N'dbo', @.source_object = N'CreditReason',
@.type = N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause = null,
@.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'Call', @.source_owner = N'dbo', @.source_object = N'Call', @.type = N'table',
@.description = null, @.column_tracking = N'true', @.pre_creation_cmd =
N'drop', @.creation_script = null, @.schema_option = 0x000000000000CFF1,
@.article_resolver = null, @.subset_filterclause =
N'(DATEADD(day, -60,CONVERT(DATETIME, CONVERT(NVARCHAR, GETDATE(),10))) <
CONVERT(DATETIME, CONVERT(NVARCHAR, ScheduleStarted,10))) AND
(CAST(LastModifiedBy AS NVARCHAR)=HOST_NAME())', @.vertical_partition =
N'false', @.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'CallObjectiveStatus', @.source_owner = N'dbo', @.source_object =
N'CallObjectiveStatus', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'QAType', @.source_owner = N'dbo', @.source_object = N'QAType', @.type =
N'table', @.description = null, @.column_tracking = N'true', @.pre_creation_cmd
= N'drop', @.creation_script = null, @.schema_option = 0x000000000000CFF1,
@.article_resolver = null, @.subset_filterclause = null, @.vertical_partition =
N'false', @.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'States', @.source_owner = N'dbo', @.source_object = N'States', @.type =
N'table', @.description = null, @.column_tracking = N'true', @.pre_creation_cmd
= N'drop', @.creation_script = null, @.schema_option = 0x000000000000CFF1,
@.article_resolver = null, @.subset_filterclause = null, @.vertical_partition =
N'false', @.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'SpecialNational', @.source_owner = N'dbo', @.source_object =
N'SpecialNational', @.type = N'table', @.description = null, @.column_tracking
= N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = N'(CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10))
>= SpecialBeginDate) AND (CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10))
<= SpecialEndDate)', @.vertical_partition = N'false', @.destination_owner =
N'dbo', @.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'ProductGroups', @.source_owner = N'dbo', @.source_object = N'ProductGroups',
@.type = N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause = null,
@.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'ProductBrands', @.source_owner = N'dbo', @.source_object = N'ProductBrands',
@.type = N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause = null,
@.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'ProductGroupOrder', @.source_owner = N'dbo', @.source_object =
N'ProductGroupOrder', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'CallObjective', @.source_owner = N'dbo', @.source_object = N'CallObjective',
@.type = N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause = null,
@.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'CallStatus', @.source_owner = N'dbo', @.source_object = N'CallStatus', @.type
= N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause = null,
@.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'QALockedProduct', @.filtername = N'QALockedProduct_QALocked',
@.join_articlename = N'QALocked', @.join_filterclause =
N'QALockedProduct.DistributorCode = QALocked.DistributorCode AND
QALockedProduct.StateCode = QALocked.StateCode AND QALockedProduct.QADealNo
= QALocked.QADealNo', @.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'CustomerDistributor', @.filtername = N'CustomerDistributor_Customers',
@.join_articlename = N'Customers', @.join_filterclause =
N'CustomerDistributor.CustomerCode = Customers.CustomerCode',
@.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'BonusDealFlavour', @.filtername = N'FK_BonusDealFlavour_BonusDeal',
@.join_articlename = N'BonusDeal', @.join_filterclause =
N'[BonusDealFlavour].[ProductCode] = [BonusDeal].[ProductCode] and
[BonusDealFlavour].[BonusDealNo] = [BonusDeal].[BonusDealNo]',
@.join_unique_key = 1
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'DistributorProductFlavour', @.filtername =
N'DistributorProductFlavour_ProductFlavour', @.join_articlename =
N'ProductFlavour', @.join_filterclause =
N'[DistributorProductFlavour].[ProductCode] = [ProductFlavour].[ProductCode]
and [DistributorProductFlavour].[FlavourCode] =
[ProductFlavour].[FlavourCode]', @.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'BonusDealState', @.filtername = N'FK_BonusDealState_BonusDeal',
@.join_articlename = N'BonusDeal', @.join_filterclause =
N'[BonusDealState].[ProductCode] = [BonusDeal].[ProductCode] and
[BonusDealState].[BonusDealNo] = [BonusDeal].[BonusDealNo]',
@.join_unique_key = 1
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'BonusDealProductState', @.filtername =
N'BonusDealProductState_BonusDealProduct', @.join_articlename =
N'BonusDealProduct', @.join_filterclause =
N'BonusDealProductState.Productcode = BonusDealProduct.ProductCode AND
BonusDealProductState.BonusDealNo = BonusDealProduct.BonusDealNo',
@.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'CustomerContact', @.filtername = N'CustomerContact_Customers',
@.join_articlename = N'Customers', @.join_filterclause =
N'CustomerContact.CustomerCode = Customers.CustomerCode', @.join_unique_key =
0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'QAMaximumProductDetail', @.filtername =
N'QAMaximumProductDetail_QAMaximumProduct', @.join_articlename =
N'QAMaximumProduct', @.join_filterclause =
N'QAMaximumProductDetail.ProductCode = QAMaximumProduct.ProductCode AND
QAMaximumProductDetail.QAMaxTermNo = QAMaximumProduct.QAMaxTermNo',
@.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'BonusDealProductCondition', @.filtername =
N'BonusDealProductCondition_BonusDealProduct', @.join_articlename =
N'BonusDealProduct', @.join_filterclause =
N'BonusDealProductCondition.ProductCode = BonusDealProduct.ProductCode AND
BonusDealProductCondition.BonusDealNo = BonusDealProduct.BonusDealNo',
@.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'BonusDealCondition', @.filtername = N'FK_BonusDealCondition_BonusDeal',
@.join_articlename = N'BonusDeal', @.join_filterclause =
N'[BonusDealCondition].[ProductCode] = [BonusDeal].[ProductCode] and
[BonusDealCondition].[BonusDealNo] = [BonusDeal].[BonusDealNo]',
@.join_unique_key = 1
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'BonusDealProductFlavourGiveOut', @.filtername =
N'BonusDealProductFlavourGiveOut_BonusDealProduct' , @.join_articlename =
N'BonusDealProduct', @.join_filterclause =
N'BonusDealProduct.ProductCode=BonusDealProductFla vourGiveOut.ProductCode
AND
BonusDealProduct.BonusDealNo=BonusDealProductFlavo urGiveOut.BonusDealNo',
@.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'BonusDealFlavourGiveOut', @.filtername =
N'BonusDealFlavourGiveOut_BonusDeal', @.join_articlename = N'BonusDeal',
@.join_filterclause =
N'BonusDeal.ProductCode=BonusDealFlavourGiveOut.Pr oductCode AND
BonusDeal.BonusDealNo = BonusDealFlavourGiveOut.BonusDealNo',
@.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'QALockedBanner', @.filtername = N'QALockedBanner_QALocked',
@.join_articlename = N'QALocked', @.join_filterclause =
N'QALockedBanner.DistributorCode = QALocked.DistributorCode AND
QALockedBanner.StateCode = QALocked.StateCode AND QALockedBanner.QADealNo =
QALocked.QADealNo', @.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'QALocked', @.filtername = N'QALocked_QALockedType', @.join_articlename =
N'QALockedType', @.join_filterclause =
N'QALockedType.DistributorCode=QALocked.Distributo rCode AND
QALockedType.StateCode=QALocked.StateCode AND
QALockedType.QADealNo=QALocked.QADealNo', @.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'CallObjective', @.filtername = N'CallObjective_Call', @.join_articlename =
N'Call', @.join_filterclause = N'CallObjective.CallID = Call.CallID',
@.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'Products', @.filtername = N'Products_ProductFlavour', @.join_articlename =
N'ProductFlavour', @.join_filterclause = N'Products.ProductCode =
ProductFlavour.ProductCode', @.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'ProductFlavour', @.filtername = N'ProductFlavour_Products',
@.join_articlename = N'Products', @.join_filterclause = N'Products.ProductCode
= ProductFlavour.ProductCode', @.join_unique_key = 0
GO
/****** End: Script to be run at Publisher: NICK ******/
What exactly is the error ? I couldn't find it in your post...
Regards,
Kestutis Adomavicius
Consultant
UAB "Baltic Software Solutions"
"victor" <gshi@.ebreathe.co.nz> wrote in message news:uSSB6LgIFHA.588@.TK2MSFTNGP15.phx.gbl...
HI all
I am using merge replication for mobile. the publication has 39 table
and one of talbe call products, my pocket pc can down snapshot database
sucessfully when product table without row filter. it always occurs
"run" error if i set a row filter (product.productInactive=0) in products
table.
Below is script......please sb can help me out here, i been stuck here
for a week.
Thanks
/****** Begin: Script to be run at Distributor: NICK ******/
/****** Installing the server Nick as a Distributor. Script Date: 2/23/2005
1:26:58 PM ******/
use master
GO
exec sp_adddistributor @.distributor = N'EBREATHEDEMO', @.password = N''
GO
-- Updating the agent profile defaults
sp_MSupdate_agenttype_default @.profile_id = 1
GO
sp_MSupdate_agenttype_default @.profile_id = 2
GO
sp_MSupdate_agenttype_default @.profile_id = 4
GO
sp_MSupdate_agenttype_default @.profile_id = 6
GO
sp_MSupdate_agenttype_default @.profile_id = 11
GO
-- Adding the distribution database
exec sp_adddistributiondb @.database = N'MSALES_Distribution', @.data_folder
= N'C:\Program Files\Microsoft SQL Server\MSSQL\Data', @.data_file =
N'MSALES_Distribution.MDF', @.data_file_size = 2, @.log_folder = N'C:\Program
Files\Microsoft SQL Server\MSSQL\Data', @.log_file =
N'MSALES_Distribution.LDF', @.log_file_size = 0, @.min_distretention = 0,
@.max_distretention = 1, @.history_retention = 48, @.security_mode = 1
GO
-- Adding the distribution publisher
exec sp_adddistpublisher @.publisher = N'EBREATHEDEMO', @.distribution_db =
N'MSALES_Distribution', @.security_mode = 1, @.working_directory =
N'\\EBREATHEDEMO\C$\Program Files\Microsoft SQL Server\MSSQL\ReplData',
@.trusted = N'false', @.thirdparty_flag = 0
GO
/****** End: Script to be run at Distributor: NICK ******/
/****** Begin: Script to be run at Publisher: NICK ******/
-- Enabling the replication database
use master
GO
exec sp_replicationdboption @.dbname = N'MSALES', @.optname = N'merge
publish', @.value = N'true'
GO
use [MSALES]
GO
-- Adding the merge publication
exec sp_addmergepublication @.publication = N'MSALES_Publication',
@.description = N'Merge publication of MSALES database from Publisher
EBREATHEDEMO.', @.retention = 14, @.sync_mode = N'character', @.allow_push =
N'true', @.allow_pull = N'true', @.allow_anonymous = N'true',
@.enabled_for_internet = N'false', @.centralized_conflicts = N'true',
@.dynamic_filters = N'true', @.snapshot_in_defaultfolder = N'true',
@.compress_snapshot = N'false', @.ftp_port = 21, @.ftp_login = N'anonymous',
@.conflict_retention = 14, @.keep_partition_changes = N'true',
@.allow_subscription_copy = N'false', @.allow_synctoalternate = N'false',
@.validate_subscriber_info = N'HOST_NAME()', @.add_to_active_directory =
N'false', @.max_concurrent_merge = 0, @.max_concurrent_dynamic_snapshots = 0
exec sp_addpublication_snapshot @.publication =
N'MSALES_Publication',@.frequency_type = 4, @.frequency_interval = 1,
@.frequency_relative_interval = 1, @.frequency_recurrence_factor = 0,
@.frequency_subday = 1, @.frequency_subday_interval = 5, @.active_start_date =
0, @.active_end_date = 0, @.active_start_time_of_day = 500,
@.active_end_time_of_day = 235959, @.snapshot_job_name =
N'EBREATHEDEMO-MSALES-MSALES_Publication-1'
GO
exec sp_grant_publication_access @.publication = N'MSALES_Publication',
@.login = N'BUILTIN\Administrators'
GO
exec sp_grant_publication_access @.publication = N'MSALES_Publication',
@.login = N'distributor_admin'
GO
exec sp_grant_publication_access @.publication = N'MSALES_Publication',
@.login = N'eBreathe'
GO
-- Adding the merge articles
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'QALockedProduct', @.source_owner = N'dbo', @.source_object =
N'QALockedProduct', @.type = N'table', @.description = null, @.column_tracking
= N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'CustomerDistributor', @.source_owner = N'dbo', @.source_object =
N'CustomerDistributor', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'BonusDealFlavour', @.source_owner = N'dbo', @.source_object =
N'BonusDealFlavour', @.type = N'table', @.description = null, @.column_tracking
= N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'DistributorProductFlavour', @.source_owner = N'dbo', @.source_object =
N'DistributorProductFlavour', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'QAMaximumFlavour', @.source_owner = N'dbo', @.source_object =
N'QAMaximumFlavour', @.type = N'table', @.description = null, @.column_tracking
= N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = N'(CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10))
>= BeginDate) AND (CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10)) <=
EndDate)', @.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'BonusDealState', @.source_owner = N'dbo', @.source_object =
N'BonusDealState', @.type = N'table', @.description = null, @.column_tracking =
N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'BonusDealProductState', @.source_owner = N'dbo', @.source_object =
N'BonusDealProductState', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'CustomerContact', @.source_owner = N'dbo', @.source_object =
N'CustomerContact', @.type = N'table', @.description = null, @.column_tracking
= N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'QALockedType', @.source_owner = N'dbo', @.source_object = N'QALockedType',
@.type = N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause =
N'(CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10)) >= BeginDate) AND
(CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10)) <= EndDate)',
@.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'QAMaximumProductDetail', @.source_owner = N'dbo', @.source_object =
N'QAMaximumProductDetail', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'BonusDealProductCondition', @.source_owner = N'dbo', @.source_object =
N'BonusDealProductCondition', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'BonusDealCondition', @.source_owner = N'dbo', @.source_object =
N'BonusDealCondition', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'ProductFlavour', @.source_owner = N'dbo', @.source_object =
N'ProductFlavour', @.type = N'table', @.description = null, @.column_tracking =
N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = N'ProductFlavourInactive=0', @.vertical_partition =
N'false', @.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'ProductGroupBannerDistributorState', @.source_owner = N'dbo',
@.source_object = N'ProductGroupBannerDistributorState', @.type = N'table',
@.description = null, @.column_tracking = N'true', @.pre_creation_cmd =
N'drop', @.creation_script = null, @.schema_option = 0x000000000000CFF1,
@.article_resolver = null, @.subset_filterclause = null, @.vertical_partition =
N'false', @.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'BonusDealProductFlavourGiveOut', @.source_owner = N'dbo', @.source_object =
N'BonusDealProductFlavourGiveOut', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'BonusDealFlavourGiveOut', @.source_owner = N'dbo', @.source_object =
N'BonusDealFlavourGiveOut', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'QALockedBanner', @.source_owner = N'dbo', @.source_object =
N'QALockedBanner', @.type = N'table', @.description = null, @.column_tracking =
N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'Customers', @.source_owner = N'dbo', @.source_object = N'Customers', @.type =
N'table', @.description = null, @.column_tracking = N'true', @.pre_creation_cmd
= N'drop', @.creation_script = null, @.schema_option = 0x000000000000CFF1,
@.article_resolver = null, @.subset_filterclause =
N'(Customers.CustomerInactive=0)AND (CAST(RepCode AS
NVARCHAR)=HOST_NAME())', @.vertical_partition = N'false', @.destination_owner
= N'dbo', @.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'QAMaximumProduct', @.source_owner = N'dbo', @.source_object =
N'QAMaximumProduct', @.type = N'table', @.description = null, @.column_tracking
= N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = N'(CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10))
>= BeginDate) AND (CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10)) <=
EndDate)', @.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'BonusDealProduct', @.source_owner = N'dbo', @.source_object =
N'BonusDealProduct', @.type = N'table', @.description = null, @.column_tracking
= N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = N'(CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10))
>= BeginDate) AND (CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10)) <=
EndDate)', @.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'BonusDeal', @.source_owner = N'dbo', @.source_object = N'BonusDeal', @.type =
N'table', @.description = null, @.column_tracking = N'true', @.pre_creation_cmd
= N'drop', @.creation_script = null, @.schema_option = 0x000000000000CFF1,
@.article_resolver = null, @.subset_filterclause =
N'(CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10)) >= BeginDate) AND
(CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10)) <= EndDate)',
@.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
--exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'Users', @.source_owner = N'dbo', @.source_object = N'Users', @.type =
N'table', @.description = null, @.column_tracking = N'true', @.pre_creation_cmd
= N'drop', @.creation_script = null, @.schema_option = 0x000000000000CFF1,
@.article_resolver = null, @.subset_filterclause = N'CAST(RepCode AS
NVARCHAR)=HOST_NAME()', @.vertical_partition = N'false', @.destination_owner =
N'dbo', @.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
--GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'DistributorWarehouse', @.source_owner = N'dbo', @.source_object =
N'DistributorWarehouse', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'QALocked', @.source_owner = N'dbo', @.source_object = N'QALocked', @.type =
N'table', @.description = null, @.column_tracking = N'true', @.pre_creation_cmd
= N'drop', @.creation_script = null, @.schema_option = 0x000000000000CFF1,
@.article_resolver = null, @.subset_filterclause = null, @.vertical_partition =
N'false', @.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'Products', @.source_owner = N'dbo', @.source_object = N'Products', @.type =
N'table', @.description = null, @.column_tracking = N'true', @.pre_creation_cmd
= N'drop', @.creation_script = null, @.schema_option = 0x000000000000CFF1,
@.article_resolver = null, @.subset_filterclause =
N'Products.ProductInactive=0', @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'DistributorState', @.source_owner = N'dbo', @.source_object =
N'DistributorState', @.type = N'table', @.description = null, @.column_tracking
= N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'SpecialState', @.source_owner = N'dbo', @.source_object = N'SpecialState',
@.type = N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause =
N'(CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10)) >= SpecialBeginDate) AND
(CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10)) <= SpecialEndDate)',
@.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'Flavours', @.source_owner = N'dbo', @.source_object = N'Flavours', @.type =
N'table', @.description = null, @.column_tracking = N'true', @.pre_creation_cmd
= N'drop', @.creation_script = null, @.schema_option = 0x000000000000CFF1,
@.article_resolver = null, @.subset_filterclause = null, @.vertical_partition =
N'false', @.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'BannerGroups', @.source_owner = N'dbo', @.source_object = N'BannerGroups',
@.type = N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause = null,
@.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'CreditReason', @.source_owner = N'dbo', @.source_object = N'CreditReason',
@.type = N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause = null,
@.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'Call', @.source_owner = N'dbo', @.source_object = N'Call', @.type = N'table',
@.description = null, @.column_tracking = N'true', @.pre_creation_cmd =
N'drop', @.creation_script = null, @.schema_option = 0x000000000000CFF1,
@.article_resolver = null, @.subset_filterclause =
N'(DATEADD(day, -60,CONVERT(DATETIME, CONVERT(NVARCHAR, GETDATE(),10))) <
CONVERT(DATETIME, CONVERT(NVARCHAR, ScheduleStarted,10))) AND
(CAST(LastModifiedBy AS NVARCHAR)=HOST_NAME())', @.vertical_partition =
N'false', @.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'CallObjectiveStatus', @.source_owner = N'dbo', @.source_object =
N'CallObjectiveStatus', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'QAType', @.source_owner = N'dbo', @.source_object = N'QAType', @.type =
N'table', @.description = null, @.column_tracking = N'true', @.pre_creation_cmd
= N'drop', @.creation_script = null, @.schema_option = 0x000000000000CFF1,
@.article_resolver = null, @.subset_filterclause = null, @.vertical_partition =
N'false', @.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'States', @.source_owner = N'dbo', @.source_object = N'States', @.type =
N'table', @.description = null, @.column_tracking = N'true', @.pre_creation_cmd
= N'drop', @.creation_script = null, @.schema_option = 0x000000000000CFF1,
@.article_resolver = null, @.subset_filterclause = null, @.vertical_partition =
N'false', @.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'SpecialNational', @.source_owner = N'dbo', @.source_object =
N'SpecialNational', @.type = N'table', @.description = null, @.column_tracking
= N'true', @.pre_creation_cmd = N'drop', @.creation_script = null,
@.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = N'(CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10))
>= SpecialBeginDate) AND (CONVERT(DATETIME,CONVERT(VARCHAR, GETDATE(),10))
<= SpecialEndDate)', @.vertical_partition = N'false', @.destination_owner =
N'dbo', @.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'ProductGroups', @.source_owner = N'dbo', @.source_object = N'ProductGroups',
@.type = N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause = null,
@.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'ProductBrands', @.source_owner = N'dbo', @.source_object = N'ProductBrands',
@.type = N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause = null,
@.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'ProductGroupOrder', @.source_owner = N'dbo', @.source_object =
N'ProductGroupOrder', @.type = N'table', @.description = null,
@.column_tracking = N'true', @.pre_creation_cmd = N'drop', @.creation_script =
null, @.schema_option = 0x000000000000CFF1, @.article_resolver = null,
@.subset_filterclause = null, @.vertical_partition = N'false',
@.destination_owner = N'dbo', @.auto_identity_range = N'false',
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'CallObjective', @.source_owner = N'dbo', @.source_object = N'CallObjective',
@.type = N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause = null,
@.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
exec sp_addmergearticle @.publication = N'MSALES_Publication', @.article =
N'CallStatus', @.source_owner = N'dbo', @.source_object = N'CallStatus', @.type
= N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause = null,
@.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'QALockedProduct', @.filtername = N'QALockedProduct_QALocked',
@.join_articlename = N'QALocked', @.join_filterclause =
N'QALockedProduct.DistributorCode = QALocked.DistributorCode AND
QALockedProduct.StateCode = QALocked.StateCode AND QALockedProduct.QADealNo
= QALocked.QADealNo', @.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'CustomerDistributor', @.filtername = N'CustomerDistributor_Customers',
@.join_articlename = N'Customers', @.join_filterclause =
N'CustomerDistributor.CustomerCode = Customers.CustomerCode',
@.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'BonusDealFlavour', @.filtername = N'FK_BonusDealFlavour_BonusDeal',
@.join_articlename = N'BonusDeal', @.join_filterclause =
N'[BonusDealFlavour].[ProductCode] = [BonusDeal].[ProductCode] and
[BonusDealFlavour].[BonusDealNo] = [BonusDeal].[BonusDealNo]',
@.join_unique_key = 1
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'DistributorProductFlavour', @.filtername =
N'DistributorProductFlavour_ProductFlavour', @.join_articlename =
N'ProductFlavour', @.join_filterclause =
N'[DistributorProductFlavour].[ProductCode] = [ProductFlavour].[ProductCode]
and [DistributorProductFlavour].[FlavourCode] =
[ProductFlavour].[FlavourCode]', @.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'BonusDealState', @.filtername = N'FK_BonusDealState_BonusDeal',
@.join_articlename = N'BonusDeal', @.join_filterclause =
N'[BonusDealState].[ProductCode] = [BonusDeal].[ProductCode] and
[BonusDealState].[BonusDealNo] = [BonusDeal].[BonusDealNo]',
@.join_unique_key = 1
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'BonusDealProductState', @.filtername =
N'BonusDealProductState_BonusDealProduct', @.join_articlename =
N'BonusDealProduct', @.join_filterclause =
N'BonusDealProductState.Productcode = BonusDealProduct.ProductCode AND
BonusDealProductState.BonusDealNo = BonusDealProduct.BonusDealNo',
@.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'CustomerContact', @.filtername = N'CustomerContact_Customers',
@.join_articlename = N'Customers', @.join_filterclause =
N'CustomerContact.CustomerCode = Customers.CustomerCode', @.join_unique_key =
0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'QAMaximumProductDetail', @.filtername =
N'QAMaximumProductDetail_QAMaximumProduct', @.join_articlename =
N'QAMaximumProduct', @.join_filterclause =
N'QAMaximumProductDetail.ProductCode = QAMaximumProduct.ProductCode AND
QAMaximumProductDetail.QAMaxTermNo = QAMaximumProduct.QAMaxTermNo',
@.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'BonusDealProductCondition', @.filtername =
N'BonusDealProductCondition_BonusDealProduct', @.join_articlename =
N'BonusDealProduct', @.join_filterclause =
N'BonusDealProductCondition.ProductCode = BonusDealProduct.ProductCode AND
BonusDealProductCondition.BonusDealNo = BonusDealProduct.BonusDealNo',
@.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'BonusDealCondition', @.filtername = N'FK_BonusDealCondition_BonusDeal',
@.join_articlename = N'BonusDeal', @.join_filterclause =
N'[BonusDealCondition].[ProductCode] = [BonusDeal].[ProductCode] and
[BonusDealCondition].[BonusDealNo] = [BonusDeal].[BonusDealNo]',
@.join_unique_key = 1
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'BonusDealProductFlavourGiveOut', @.filtername =
N'BonusDealProductFlavourGiveOut_BonusDealProduct' , @.join_articlename =
N'BonusDealProduct', @.join_filterclause =
N'BonusDealProduct.ProductCode=BonusDealProductFla vourGiveOut.ProductCode
AND
BonusDealProduct.BonusDealNo=BonusDealProductFlavo urGiveOut.BonusDealNo',
@.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'BonusDealFlavourGiveOut', @.filtername =
N'BonusDealFlavourGiveOut_BonusDeal', @.join_articlename = N'BonusDeal',
@.join_filterclause =
N'BonusDeal.ProductCode=BonusDealFlavourGiveOut.Pr oductCode AND
BonusDeal.BonusDealNo = BonusDealFlavourGiveOut.BonusDealNo',
@.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'QALockedBanner', @.filtername = N'QALockedBanner_QALocked',
@.join_articlename = N'QALocked', @.join_filterclause =
N'QALockedBanner.DistributorCode = QALocked.DistributorCode AND
QALockedBanner.StateCode = QALocked.StateCode AND QALockedBanner.QADealNo =
QALocked.QADealNo', @.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'QALocked', @.filtername = N'QALocked_QALockedType', @.join_articlename =
N'QALockedType', @.join_filterclause =
N'QALockedType.DistributorCode=QALocked.Distributo rCode AND
QALockedType.StateCode=QALocked.StateCode AND
QALockedType.QADealNo=QALocked.QADealNo', @.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'CallObjective', @.filtername = N'CallObjective_Call', @.join_articlename =
N'Call', @.join_filterclause = N'CallObjective.CallID = Call.CallID',
@.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'Products', @.filtername = N'Products_ProductFlavour', @.join_articlename =
N'ProductFlavour', @.join_filterclause = N'Products.ProductCode =
ProductFlavour.ProductCode', @.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'MSALES_Publication', @.article =
N'ProductFlavour', @.filtername = N'ProductFlavour_Products',
@.join_articlename = N'Products', @.join_filterclause = N'Products.ProductCode
= ProductFlavour.ProductCode', @.join_unique_key = 0
GO
/****** End: Script to be run at Publisher: NICK ******/