Showing posts with label generate. Show all posts
Showing posts with label generate. Show all posts

Thursday, March 22, 2012

Combining 2 tables with date ranges

Hi there, I'm trying to generate a report for an old database and I'm
having trouble coming up with an elegant way of going about it. Using
cursors and other 'ugly' tools I could get the job done but 1) I don't
want the report to take ages to run, 2) I'm not a big fan of cursors!

Basically there are tables that track history and each table tends to
track only a specific value housed within a date range. I'm trying to
combine the tables to get a snap-shot of the complete history. I'm
having problems dealing with the Start/End Dates from the two tables
and building the dates in the final table to be broken down by 'history
type'.

Here are a few sample records and the results I'm trying to achieve:

Table 1:
CAgyHist (ProdID,AgyID,StartDate,EndDate)
1 1 Jan 1, 2006 Jan 5, 2006
1 2 Jan 5, 2006 Jan 25, 2006
1 1 Jan 25, 2006 NULL

Table 2:
CInvHist (ProdID, InvID,StartDate,EndDate)
1 1 Jan 1, 2006 Jan 23, 2006
1 2 Jan 23, 2006 Jan 15, 2006
1 1 Jan 15, 2006 NULL

Desired End Result:
CTotalHist (ProdID,AgyID,InvID,StartDate,EndDate)
1 1 1 Jan 1, 2006 Jan 5, 2006
1 2 1 Jan 5, 2006 Jan 15, 2006
1 2 2 Jan 15, 2006 Jan 23, 2006
1 2 1 Jan 23, 2006 Jan 25, 2006
1 1 1 Jan 25, 2006 NULL

My challenge thus far has been dealing with the dates as they don't
necessarily correspond - from one table to the other.

I am by no means a database expert of any level and any help would be
greatly appreciated.

Thanks,
Frank.what do you mean by , "the dates don't correspond from 1 table to the
other"?

--
Jack Vamvas
___________________________________
Receive free SQL tips - www.ciquery.com/sqlserver.htm
___________________________________

"Frank" <mrpubnight@.hotmail.com> wrote in message
news:1151369612.360817.191930@.c74g2000cwc.googlegr oups.com...
> Hi there, I'm trying to generate a report for an old database and I'm
> having trouble coming up with an elegant way of going about it. Using
> cursors and other 'ugly' tools I could get the job done but 1) I don't
> want the report to take ages to run, 2) I'm not a big fan of cursors!
> Basically there are tables that track history and each table tends to
> track only a specific value housed within a date range. I'm trying to
> combine the tables to get a snap-shot of the complete history. I'm
> having problems dealing with the Start/End Dates from the two tables
> and building the dates in the final table to be broken down by 'history
> type'.
> Here are a few sample records and the results I'm trying to achieve:
> Table 1:
> CAgyHist (ProdID,AgyID,StartDate,EndDate)
> 1 1 Jan 1, 2006 Jan 5, 2006
> 1 2 Jan 5, 2006 Jan 25, 2006
> 1 1 Jan 25, 2006 NULL
> Table 2:
> CInvHist (ProdID, InvID,StartDate,EndDate)
> 1 1 Jan 1, 2006 Jan 23, 2006
> 1 2 Jan 23, 2006 Jan 15, 2006
> 1 1 Jan 15, 2006 NULL
> Desired End Result:
> CTotalHist (ProdID,AgyID,InvID,StartDate,EndDate)
> 1 1 1 Jan 1, 2006 Jan 5, 2006
> 1 2 1 Jan 5, 2006 Jan 15, 2006
> 1 2 2 Jan 15, 2006 Jan 23, 2006
> 1 2 1 Jan 23, 2006 Jan 25, 2006
> 1 1 1 Jan 25, 2006 NULL
> My challenge thus far has been dealing with the dates as they don't
> necessarily correspond - from one table to the other.
> I am by no means a database expert of any level and any help would be
> greatly appreciated.
> Thanks,
> Frank.|||>From your data, CInvHist has this row

CInvHist (ProdID, InvID,StartDate,EndDate)
1 2 Jan 23, 2006 Jan 15, 2006

which has StartDate *after* the EndDate. Is this what you mean?|||It looks like you want to treat the 2 tables as one so you can sort by
the start date? If so, then you can use a union query and use the order
by clause at the end of the second select statement like:
select * from table1
union
select * from table2
order by start date

Jason|||Frank (mrpubnight@.hotmail.com) writes:
> Basically there are tables that track history and each table tends to
> track only a specific value housed within a date range. I'm trying to
> combine the tables to get a snap-shot of the complete history. I'm
> having problems dealing with the Start/End Dates from the two tables
> and building the dates in the final table to be broken down by 'history
> type'.
> Here are a few sample records and the results I'm trying to achieve:
> Table 1:
> CAgyHist (ProdID,AgyID,StartDate,EndDate)
> 1 1 Jan 1, 2006 Jan 5, 2006
> 1 2 Jan 5, 2006 Jan 25, 2006
> 1 1 Jan 25, 2006 NULL
> Table 2:
> CInvHist (ProdID, InvID,StartDate,EndDate)
> 1 1 Jan 1, 2006 Jan 23, 2006
> 1 2 Jan 23, 2006 Jan 15, 2006
> 1 1 Jan 15, 2006 NULL
> Desired End Result:
> CTotalHist (ProdID,AgyID,InvID,StartDate,EndDate)
> 1 1 1 Jan 1, 2006 Jan 5, 2006
> 1 2 1 Jan 5, 2006 Jan 15, 2006
> 1 2 2 Jan 15, 2006 Jan 23, 2006
> 1 2 1 Jan 23, 2006 Jan 25, 2006
> 1 1 1 Jan 25, 2006 NULL
> My challenge thus far has been dealing with the dates as they don't
> necessarily correspond - from one table to the other.

There should be a fair chance to this in a query (or possibly two
with help of some temp table). But since it's bit complex, the hour
is late, and your sample data is unclear, I prefer to ask for
clarification:

1) What are the keys of these tables?
2) What do they signify?
3) What is the combined table supposed to describe?
4) Is that interval from Jan 23 to Jan 15 intentional or is a typo?
In the latter case, can you provide an updated sample?
--
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|||Sorry everyone there was a typo and I will expand a little as well.

1) The keys are as follows (both tables have primary ID keys too but
they weren't included in the original question - see brackets below)
CAgyHist:
(CAH_ID PK)
ProdID FK
AgyID FK

CInvHist:
(CIH_ID PK)
ProdID FK
InvID FK

2) ProdID = PK from the products table.
AgyID = PK from the Agency table (i.e. Supplier)
InvID = PK from the InventoryType table (categorization for products)

3) Products in our application can move from supplier to supplier and
can also change their categorization. Each of the history tables
tracks these changes as they occur and when they occur. The start date
is obviously when the product begins with the corresponding agency or
categorization, and the end date is when it finishes (a NULL value
means that the product is still with a given agency or being
categorized in a certain manner.

The problem I want/need to solve is I need a complete historical
account for a product as it moves from agency to agency and from
categorization to categorization and I need it to be on a single report
(table) and chronological, so hence the final table which shows how the
product has moved throughout time.

4) Yes, sorry that was a typo. The CInvHist table records should have
read:

Table 2:
CInvHist (ProdID, InvID,StartDate,EndDate)
1 1 Jan 1, 2006 Jan 15, 2006
1 2 Jan 15, 2006 Jan 23, 2006
1 1 Jan 23, 2006 NULL

Sorry about all that confusion. I'm really hoping that this isn't too
tough or time consuming (from an execution point of view).

Again, any help will be appreciated.

Thanks,
Frank

Erland Sommarskog wrote:
> Frank (mrpubnight@.hotmail.com) writes:
> > Basically there are tables that track history and each table tends to
> > track only a specific value housed within a date range. I'm trying to
> > combine the tables to get a snap-shot of the complete history. I'm
> > having problems dealing with the Start/End Dates from the two tables
> > and building the dates in the final table to be broken down by 'history
> > type'.
> > Here are a few sample records and the results I'm trying to achieve:
> > Table 1:
> > CAgyHist (ProdID,AgyID,StartDate,EndDate)
> > 1 1 Jan 1, 2006 Jan 5, 2006
> > 1 2 Jan 5, 2006 Jan 25, 2006
> > 1 1 Jan 25, 2006 NULL
> > Table 2:
> > CInvHist (ProdID, InvID,StartDate,EndDate)
> > 1 1 Jan 1, 2006 Jan 23, 2006
> > 1 2 Jan 23, 2006 Jan 15, 2006
> > 1 1 Jan 15, 2006 NULL
> > Desired End Result:
> > CTotalHist (ProdID,AgyID,InvID,StartDate,EndDate)
> > 1 1 1 Jan 1, 2006 Jan 5, 2006
> > 1 2 1 Jan 5, 2006 Jan 15, 2006
> > 1 2 2 Jan 15, 2006 Jan 23, 2006
> > 1 2 1 Jan 23, 2006 Jan 25, 2006
> > 1 1 1 Jan 25, 2006 NULL
> > My challenge thus far has been dealing with the dates as they don't
> > necessarily correspond - from one table to the other.
> There should be a fair chance to this in a query (or possibly two
> with help of some temp table). But since it's bit complex, the hour
> is late, and your sample data is unclear, I prefer to ask for
> clarification:
> 1) What are the keys of these tables?
> 2) What do they signify?
> 3) What is the combined table supposed to describe?
> 4) Is that interval from Jan 23 to Jan 15 intentional or is a typo?
> In the latter case, can you provide an updated sample?
> --
> 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|||Your sample data is a mess, but the usual way is to build a calendar
and join these improperly designed tables together with BETWEEN
predicates, something like:

SELECT C.cal_date, T1.a, T2.b, ..
FROM Calendar AS C, T1, T2
WHERE C.cal_date BETWEEN T1.start_date AND T1.end_date
AND C.cal_date BETWEEN T2.start_date AND T2.end_date
AND .. ;

MIssing or reversed data will not be shown in this query.|||Frank (mrpubnight@.hotmail.com) writes:
> 1) The keys are as follows (both tables have primary ID keys too but
> they weren't included in the original question - see brackets below)
> CAgyHist:
> (CAH_ID PK)
> ProdID FK
> AgyID FK
> CInvHist:
> (CIH_ID PK)
> ProdID FK
> InvID FK

That's a bit problematic. It s not clear whether I can trust whether
ProdID, StartDate can be unique, or whether there can be more entries for
the same day and product. In my solution below, I have assumed they are
unique. Then again, if they were there is no reason for that CAH_ID.

Here is a query that works with your sample data. I will have to admit
that I'm not fully certain on how it works, and I would recommend you
to test further. I would also suggest that you check out
http://groups.google.com/group/comp...48dda4c48fb808b
for a similar problem.

CREATE TABLE CAgyHist (ProdID int NOT NULL,
AgyID int NOT NULL,
StartDate datetime NOT NULL,
EndDate datetime NULL,
PRIMARY KEY(ProdID, StartDate))

CREATE TABLE CInvHist (ProdID int NOT NULL,
InvID int NOT NULL,
StartDate datetime NOT NULL,
EndDate datetime NULL,
PRIMARY KEY(ProdID, StartDate))

INSERT CAgyHist(ProdID,AgyID,StartDate,EndDate)
SELECT 1, 1, 'Jan 1, 2006', 'Jan 5, 2006'
UNION
SELECT 1, 2, 'Jan 5, 2006', 'Jan 25, 2006'
UNION
SELECT 1, 1, 'Jan 25, 2006', NULL

INSERT CInvHist (ProdID, InvID,StartDate,EndDate)
SELECT 1, 1, 'Jan 1, 2006', 'Jan 15, 2006'
UNION
SELECT 1, 2, 'Jan 15, 2006', 'Jan 23, 2006'
UNION
SELECT 1, 1, 'Jan 23, 2006', NULL

SELECT ProdID, AgyID, InvID, StartDate, EndDate
FROM (SELECT a.ProdID, a.AgyID, i.InvID,
CASE WHEN a.StartDate > i.StartDate
THEN a.StartDate
ELSE i.StartDate
END AS StartDate,
CASE WHEN coalesce(a.EndDate, '99991231') <
coalesce(i.EndDate ,'99991231')
THEN a.EndDate
ELSE i.EndDate
END AS EndDate
FROM CAgyHist a
JOIN CInvHist i ON a.ProdID = i.ProdID) AS x
WHERE StartDate < coalesce(EndDate, '99991231')
ORDER BY StartDate, EndDate
go
DROP TABLE CAgyHist
DROP TABLE CInvHist

--
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

Tuesday, March 20, 2012

combine pdf with reporting services pdfs

Through another software package, I generate pdfs which I save. I now want to combine those pdf with pdf output from reporting services. how can i do this?

thks

ken

Hi Ken-

You'd need to create your own delivery extension to do that. I imagine you could add the PDF to the RS rendered PDFs in the Deliver method of your custom delivery provider. Check out the PrinterDeliverySample in the Samples folder where you installed RS. This example can give you an idea of what you need to do to set this up.

Scott

Combine multiple RDL files into one RDL file

Hello,

I need to generate a report, which should display 4 reports. Two tables and some charts. I have all these reports (I mean the .RDL files) individually. I can render the reports separately. But, now the need is to combine these reports in the one RDL file. Is this possible? If yes, how?

Also, I tried to create a stored procedure, which would call all these 4 SP inturn and provide 4 result sets. I thought of have an RDL by calling only this SP which would give 4 result sets. But infortunately, it gave only the first SP's result set. So, I have to combine the 4 RDL files into one to show on the Reporting Console. Can anyone please help me in this? Help would be grately appreciated.

Thanks a lot. Let me know if the question is not clear.

Mannu.

Well let's see.

You would need to create 4 datasets, one for each of the original reports. You can do this on the data tab by clicking the dataset drop down and Add new dataset.

Then, copy and paste each of the individual layouts into this "super" report.

On each of the tables and charts, go to the properties for the table or chart and select the appropriate dataset as the "dataset name" that you created.

|||

Yes GregSQL gives you right approach for the problem but there is a catch.

If you create 4 datasets using same SP that will still give you the first resultset. To overcome this issue I believe you have to pass an extra parameter say ReportType with datatype as Char. Give a condition in SP to return the Dataset you want to return for that perticular ReportType.

IN StoredProcedure:

IF @.ReportType = 'A'

BEGIN

YOUR DATASET

END

IF @.ReportType = 'B'

BEGIN

YOUR DATASET

END

Comming to report , click on each Dataset and go to Parameters section and give the ReportType value for each dataresult.'A' for First Dataset, 'B' for Second Datset.

I think this will complete the whole scenario...

Hope this helps

Sunday, February 19, 2012

column filter problem

Hi All:
I use merge replication in SQL server with column filter and row
filter , it works fine. so that i generate a script.
when i tried to run this script on another computer , i got warning
as below:
Warning: only Subscribers running SQL Server 2000 can synchronize with
publication 'eBreathe_Publication' because vertical filters are being used.
and say some tables doex not exist. i check all tables does exist
i just so confused , anyone know how to work it out?
Cheers
nick
Completed script as below:
-- Enabling the replication database
use master
GO
exec sp_replicationdboption @.dbname = N'eBreathe', @.optname = N'merge
publish', @.value = N'true'
GO
use [eBreathe]
GO
-- Adding the merge publication
exec sp_addmergepublication @.publication = N'eBreathe_Publication',
@.description = N'Merge publication of eBreathe database from Publisher
NICK.', @.retention = 30, @.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'eBreathe_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'NICK-eBreathe-eBreathe_Publication-1'
GO
exec sp_grant_publication_access @.publication = N'eBreathe_Publication',
@.login = N'BUILTIN\Administrators'
GO
exec sp_grant_publication_access @.publication = N'eBreathe_Publication',
@.login = N'distributor_admin'
GO
exec sp_grant_publication_access @.publication = N'eBreathe_Publication',
@.login = N'NICK\IUSR_NICK'
GO
exec sp_grant_publication_access @.publication = N'eBreathe_Publication',
@.login = N'sa'
GO
-- Adding the merge articles
exec sp_addmergearticle @.publication = N'eBreathe_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'SalesRepCode =
HOST_NAME()', @.vertical_partition = N'true', @.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's partition column(s)
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Customers', @.column = N'CustomerCode', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Customers', @.column = N'CustomerGroupCode', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Customers', @.column = N'CustomerName', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Customers', @.column = N'CustomerAddress1', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Customers', @.column = N'CustomerAddress2', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Customers', @.column = N'CustomerAddress3', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Customers', @.column = N'CustomerPostCode', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Customers', @.column = N'StateCode', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Customers', @.column = N'CustomerCountry', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Customers', @.column = N'SalesRepCode', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Customers', @.column = N'rowguid', @.operation = N'add'
GO
exec sp_addmergearticle @.publication = N'eBreathe_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'true',
@.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's partition column(s)
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'CustomerContact', @.column = N'CustomerContactCode', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'CustomerContact', @.column = N'CustomerCode', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'CustomerContact', @.column = N'CustomerContactName', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'CustomerContact', @.column = N'CustomerContactPosition', @.operation =
N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'CustomerContact', @.column = N'CustomerContactMobilePhone', @.operation =
N'add'
GO
exec sp_addmergearticle @.publication = N'eBreathe_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
exec sp_addmergearticle @.publication = N'eBreathe_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'eBreathe_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 =
N'(CallObjective.IsDeleted = 0)', @.vertical_partition = N'true',
@.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's partition column(s)
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'CallObjective', @.column = N'CallObjectiveID', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'CallObjective', @.column = N'CallID', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'CallObjective', @.column = N'Description', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'CallObjective', @.column = N'CallObjectiveStatusID', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'CallObjective', @.column = N'IsDeleted', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'CallObjective', @.column = N'LastModifiedBy', @.operation = N'add'
GO
exec sp_addmergearticle @.publication = N'eBreathe_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'(Call.IsDeleted = 0)',
@.vertical_partition = N'true', @.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's partition column(s)
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Call', @.column = N'CallID', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Call', @.column = N'CustomerCode', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Call', @.column = N'ScheduleStarted', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Call', @.column = N'ScheduleEnded', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Call', @.column = N'ActualStarted', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Call', @.column = N'ActualEnded', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Call', @.column = N'CallStatusID', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Call', @.column = N'IsDeleted', @.operation = N'add'
GO
exec sp_addmergearticle @.publication = N'eBreathe_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'SalesRepCode =
HOST_NAME() AND (IsDisabled = 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'eBreathe_Publication', @.article =
N'TemplateLine', @.source_owner = N'dbo', @.source_object = N'TemplateLine',
@.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'eBreathe_Publication', @.article =
N'Template', @.source_owner = N'dbo', @.source_object = N'Template', @.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'true', @.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's partition column(s)
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Template', @.column = N'TemplateID', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Template', @.column = N'Description', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Template', @.column = N'CreationDate', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Template', @.column = N'rowguid', @.operation = N'add'
GO
exec sp_addmergearticle @.publication = N'eBreathe_Publication', @.article =
N'SalesRep', @.source_owner = N'dbo', @.source_object = N'SalesRep', @.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'SalesRepCode =
HOST_NAME()', @.vertical_partition = N'true', @.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's partition column(s)
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'SalesRep', @.column = N'SalesRepCode', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'SalesRep', @.column = N'SalesRepName', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'SalesRep', @.column = N'CompanyCode', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'SalesRep', @.column = N'SalesRepAddress', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'SalesRep', @.column = N'SalesRepCity', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'SalesRep', @.column = N'SalesRepPhone', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'SalesRep', @.column = N'SalesRepFax', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'SalesRep', @.column = N'NextOrderRef', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'SalesRep', @.column = N'rowguid', @.operation = N'add'
GO
exec sp_addmergearticle @.publication = N'eBreathe_Publication', @.article =
N'ItemSubClass', @.source_owner = N'dbo', @.source_object = N'ItemSubClass',
@.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'true', @.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's partition column(s)
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'ItemSubClass', @.column = N'ItemSubClassCode', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'ItemSubClass', @.column = N'ItemSubClassDescription', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'ItemSubClass', @.column = N'rowguid', @.operation = N'add'
GO
exec sp_addmergearticle @.publication = N'eBreathe_Publication', @.article =
N'Items', @.source_owner = N'dbo', @.source_object = N'Items', @.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'true', @.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's partition column(s)
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Items', @.column = N'ItemCode', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Items', @.column = N'ItemSubClassCode', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Items', @.column = N'ItemGroupCode', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Items', @.column = N'ItemClassCode', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Items', @.column = N'ItemName', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Items', @.column = N'ItemMeasureUnit', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Items', @.column = N'ItemUnitPrice', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'Items', @.column = N'rowguid', @.operation = N'add'
GO
exec sp_addmergearticle @.publication = N'eBreathe_Publication', @.article =
N'ItemGroup', @.source_owner = N'dbo', @.source_object = N'ItemGroup', @.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'true', @.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's partition column(s)
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'ItemGroup', @.column = N'ItemGroupCode', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'ItemGroup', @.column = N'ItemGroupDescription', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'ItemGroup', @.column = N'rowguid', @.operation = N'add'
GO
exec sp_addmergearticle @.publication = N'eBreathe_Publication', @.article =
N'ItemClass', @.source_owner = N'dbo', @.source_object = N'ItemClass', @.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'true', @.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's partition column(s)
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'ItemClass', @.column = N'ItemClassCode', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'ItemClass', @.column = N'ItemClassDescription', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'ItemClass', @.column = N'rowguid', @.operation = N'add'
GO
exec sp_addmergearticle @.publication = N'eBreathe_Publication', @.article =
N'InvoiceLine', @.source_owner = N'dbo', @.source_object = N'InvoiceLine',
@.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'true', @.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's partition column(s)
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'InvoiceLine', @.column = N'InvoiceLineID', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'InvoiceLine', @.column = N'InvoiceID', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'InvoiceLine', @.column = N'LineID', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'InvoiceLine', @.column = N'InvoiceItemID', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'InvoiceLine', @.column = N'AppliedDocDate', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'InvoiceLine', @.column = N'AppliedAmount', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'InvoiceLine', @.column = N'CreationDate', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'InvoiceLine', @.column = N'EffectiveDate', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'InvoiceLine', @.column = N'ExpiryDate', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'InvoiceLine', @.column = N'rowguid', @.operation = N'add'
GO
exec sp_addmergearticle @.publication = N'eBreathe_Publication', @.article =
N'InvoiceHeader', @.source_owner = N'dbo', @.source_object = N'InvoiceHeader',
@.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'true', @.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's partition column(s)
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'InvoiceHeader', @.column = N'InvoiceID', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'InvoiceHeader', @.column = N'InvoiceType', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'InvoiceHeader', @.column = N'CustomerCode', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'InvoiceHeader', @.column = N'ARDocDate', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'InvoiceHeader', @.column = N'LinkTxnID', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'InvoiceHeader', @.column = N'OriginalAmount', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'InvoiceHeader', @.column = N'BalanceAmount', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'InvoiceHeader', @.column = N'EffectiveDate', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'InvoiceHeader', @.column = N'ExpiryDate', @.operation = N'add'
GO
exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication', @.article
= N'InvoiceHeader', @.column = N'rowguid', @.operation = N'add'
GO
exec sp_addmergearticle @.publication = N'eBreathe_Publication', @.article =
N'CustomerGroups', @.source_owner = N'dbo', @.source_object =
N'CustomerGroups', @.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'eBreathe_Publication', @.article =
N'BE_ItemCode', @.source_owner = N'dbo', @.source_object = N'BE_ItemCode',
@.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'eBreathe_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'eBreathe_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'eBreathe_Publication', @.article =
N'Call', @.filtername = N'Call_Customers', @.join_articlename = N'Customers',
@.join_filterclause = N'Call.CustomerCode = Customers.CustomerCode',
@.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'eBreathe_Publication', @.article =
N'InvoiceLine', @.filtername = N'InvoiceLine_InvoiceHeader',
@.join_articlename = N'InvoiceHeader', @.join_filterclause =
N'InvoiceHeader.InvoiceID = InvoiceLine.InvoiceID', @.join_unique_key = 0
GO
-- Adding the article subset filter
exec sp_addmergefilter @.publication = N'eBreathe_Publication', @.article =
N'InvoiceHeader', @.filtername = N'InvoiceHeader_Customers',
@.join_articlename = N'Customers', @.join_filterclause =
N'Customers.CustomerCode = InvoiceHeader.CustomerCode', @.join_unique_key = 0
GO
when we using column filter on certain tables that do not all primary key be
rowguid, is that this caused my problem?
because three tables cause error , which have one primary key as
uniqueidentifier and isRowGuid enable,
Cheers
nick
"Nick" <fsheng@.ebreathe.co.nz> wrote in message
news:OrEvGs$CFHA.3132@.TK2MSFTNGP09.phx.gbl...
> Hi All:
> I use merge replication in SQL server with column filter and row
> filter , it works fine. so that i generate a script.
> when i tried to run this script on another computer , i got warning
> as below:
> Warning: only Subscribers running SQL Server 2000 can synchronize with
> publication 'eBreathe_Publication' because vertical filters are being
used.
> and say some tables doex not exist. i check all tables does exist
> i just so confused , anyone know how to work it out?
> Cheers
> nick
> Completed script as below:
> -- Enabling the replication database
> use master
> GO
> exec sp_replicationdboption @.dbname = N'eBreathe', @.optname = N'merge
> publish', @.value = N'true'
> GO
> use [eBreathe]
> GO
> -- Adding the merge publication
> exec sp_addmergepublication @.publication = N'eBreathe_Publication',
> @.description = N'Merge publication of eBreathe database from Publisher
> NICK.', @.retention = 30, @.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'eBreathe_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'NICK-eBreathe-eBreathe_Publication-1'
> GO
> exec sp_grant_publication_access @.publication = N'eBreathe_Publication',
> @.login = N'BUILTIN\Administrators'
> GO
> exec sp_grant_publication_access @.publication = N'eBreathe_Publication',
> @.login = N'distributor_admin'
> GO
> exec sp_grant_publication_access @.publication = N'eBreathe_Publication',
> @.login = N'NICK\IUSR_NICK'
> GO
> exec sp_grant_publication_access @.publication = N'eBreathe_Publication',
> @.login = N'sa'
> GO
> -- Adding the merge articles
> exec sp_addmergearticle @.publication = N'eBreathe_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'SalesRepCode =
> HOST_NAME()', @.vertical_partition = N'true', @.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's partition column(s)
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Customers', @.column = N'CustomerCode', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Customers', @.column = N'CustomerGroupCode', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Customers', @.column = N'CustomerName', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Customers', @.column = N'CustomerAddress1', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Customers', @.column = N'CustomerAddress2', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Customers', @.column = N'CustomerAddress3', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Customers', @.column = N'CustomerPostCode', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Customers', @.column = N'StateCode', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Customers', @.column = N'CustomerCountry', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Customers', @.column = N'SalesRepCode', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Customers', @.column = N'rowguid', @.operation = N'add'
> GO
> exec sp_addmergearticle @.publication = N'eBreathe_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'true',
> @.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's partition column(s)
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'CustomerContact', @.column = N'CustomerContactCode', @.operation =
N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'CustomerContact', @.column = N'CustomerCode', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'CustomerContact', @.column = N'CustomerContactName', @.operation =
N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'CustomerContact', @.column = N'CustomerContactPosition', @.operation =
> N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'CustomerContact', @.column = N'CustomerContactMobilePhone', @.operation
=
> N'add'
> GO
> exec sp_addmergearticle @.publication = N'eBreathe_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
> exec sp_addmergearticle @.publication = N'eBreathe_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'eBreathe_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 =
> N'(CallObjective.IsDeleted = 0)', @.vertical_partition = N'true',
> @.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's partition column(s)
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'CallObjective', @.column = N'CallObjectiveID', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'CallObjective', @.column = N'CallID', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'CallObjective', @.column = N'Description', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'CallObjective', @.column = N'CallObjectiveStatusID', @.operation =
N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'CallObjective', @.column = N'IsDeleted', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'CallObjective', @.column = N'LastModifiedBy', @.operation = N'add'
> GO
> exec sp_addmergearticle @.publication = N'eBreathe_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'(Call.IsDeleted = 0)',
> @.vertical_partition = N'true', @.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's partition column(s)
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Call', @.column = N'CallID', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Call', @.column = N'CustomerCode', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Call', @.column = N'ScheduleStarted', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Call', @.column = N'ScheduleEnded', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Call', @.column = N'ActualStarted', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Call', @.column = N'ActualEnded', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Call', @.column = N'CallStatusID', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Call', @.column = N'IsDeleted', @.operation = N'add'
> GO
> exec sp_addmergearticle @.publication = N'eBreathe_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'SalesRepCode =
> HOST_NAME() AND (IsDisabled = 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'eBreathe_Publication', @.article =
> N'TemplateLine', @.source_owner = N'dbo', @.source_object = N'TemplateLine',
> @.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'eBreathe_Publication', @.article =
> N'Template', @.source_owner = N'dbo', @.source_object = N'Template', @.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'true', @.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's partition column(s)
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Template', @.column = N'TemplateID', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Template', @.column = N'Description', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Template', @.column = N'CreationDate', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Template', @.column = N'rowguid', @.operation = N'add'
> GO
> exec sp_addmergearticle @.publication = N'eBreathe_Publication', @.article =
> N'SalesRep', @.source_owner = N'dbo', @.source_object = N'SalesRep', @.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'SalesRepCode =
> HOST_NAME()', @.vertical_partition = N'true', @.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's partition column(s)
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'SalesRep', @.column = N'SalesRepCode', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'SalesRep', @.column = N'SalesRepName', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'SalesRep', @.column = N'CompanyCode', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'SalesRep', @.column = N'SalesRepAddress', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'SalesRep', @.column = N'SalesRepCity', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'SalesRep', @.column = N'SalesRepPhone', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'SalesRep', @.column = N'SalesRepFax', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'SalesRep', @.column = N'NextOrderRef', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'SalesRep', @.column = N'rowguid', @.operation = N'add'
> GO
> exec sp_addmergearticle @.publication = N'eBreathe_Publication', @.article =
> N'ItemSubClass', @.source_owner = N'dbo', @.source_object = N'ItemSubClass',
> @.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'true', @.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's partition column(s)
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'ItemSubClass', @.column = N'ItemSubClassCode', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'ItemSubClass', @.column = N'ItemSubClassDescription', @.operation =
N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'ItemSubClass', @.column = N'rowguid', @.operation = N'add'
> GO
> exec sp_addmergearticle @.publication = N'eBreathe_Publication', @.article =
> N'Items', @.source_owner = N'dbo', @.source_object = N'Items', @.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'true', @.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's partition column(s)
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Items', @.column = N'ItemCode', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Items', @.column = N'ItemSubClassCode', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Items', @.column = N'ItemGroupCode', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Items', @.column = N'ItemClassCode', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Items', @.column = N'ItemName', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Items', @.column = N'ItemMeasureUnit', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Items', @.column = N'ItemUnitPrice', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'Items', @.column = N'rowguid', @.operation = N'add'
> GO
> exec sp_addmergearticle @.publication = N'eBreathe_Publication', @.article =
> N'ItemGroup', @.source_owner = N'dbo', @.source_object = N'ItemGroup', @.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'true', @.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's partition column(s)
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'ItemGroup', @.column = N'ItemGroupCode', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'ItemGroup', @.column = N'ItemGroupDescription', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'ItemGroup', @.column = N'rowguid', @.operation = N'add'
> GO
> exec sp_addmergearticle @.publication = N'eBreathe_Publication', @.article =
> N'ItemClass', @.source_owner = N'dbo', @.source_object = N'ItemClass', @.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'true', @.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's partition column(s)
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'ItemClass', @.column = N'ItemClassCode', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'ItemClass', @.column = N'ItemClassDescription', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'ItemClass', @.column = N'rowguid', @.operation = N'add'
> GO
> exec sp_addmergearticle @.publication = N'eBreathe_Publication', @.article =
> N'InvoiceLine', @.source_owner = N'dbo', @.source_object = N'InvoiceLine',
> @.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'true', @.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's partition column(s)
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'InvoiceLine', @.column = N'InvoiceLineID', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'InvoiceLine', @.column = N'InvoiceID', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'InvoiceLine', @.column = N'LineID', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'InvoiceLine', @.column = N'InvoiceItemID', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'InvoiceLine', @.column = N'AppliedDocDate', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'InvoiceLine', @.column = N'AppliedAmount', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'InvoiceLine', @.column = N'CreationDate', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'InvoiceLine', @.column = N'EffectiveDate', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'InvoiceLine', @.column = N'ExpiryDate', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'InvoiceLine', @.column = N'rowguid', @.operation = N'add'
> GO
> exec sp_addmergearticle @.publication = N'eBreathe_Publication', @.article =
> N'InvoiceHeader', @.source_owner = N'dbo', @.source_object =
N'InvoiceHeader',
> @.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'true', @.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's partition column(s)
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'InvoiceHeader', @.column = N'InvoiceID', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'InvoiceHeader', @.column = N'InvoiceType', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'InvoiceHeader', @.column = N'CustomerCode', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'InvoiceHeader', @.column = N'ARDocDate', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'InvoiceHeader', @.column = N'LinkTxnID', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'InvoiceHeader', @.column = N'OriginalAmount', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'InvoiceHeader', @.column = N'BalanceAmount', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'InvoiceHeader', @.column = N'EffectiveDate', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'InvoiceHeader', @.column = N'ExpiryDate', @.operation = N'add'
> GO
> exec sp_mergearticlecolumn @.publication = N'eBreathe_Publication',
@.article
> = N'InvoiceHeader', @.column = N'rowguid', @.operation = N'add'
> GO
> exec sp_addmergearticle @.publication = N'eBreathe_Publication', @.article =
> N'CustomerGroups', @.source_owner = N'dbo', @.source_object =
> N'CustomerGroups', @.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'eBreathe_Publication', @.article =
> N'BE_ItemCode', @.source_owner = N'dbo', @.source_object = N'BE_ItemCode',
> @.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'eBreathe_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'eBreathe_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'eBreathe_Publication', @.article =
> N'Call', @.filtername = N'Call_Customers', @.join_articlename =
N'Customers',
> @.join_filterclause = N'Call.CustomerCode = Customers.CustomerCode',
> @.join_unique_key = 0
> GO
> -- Adding the article subset filter
> exec sp_addmergefilter @.publication = N'eBreathe_Publication', @.article =
> N'InvoiceLine', @.filtername = N'InvoiceLine_InvoiceHeader',
> @.join_articlename = N'InvoiceHeader', @.join_filterclause =
> N'InvoiceHeader.InvoiceID = InvoiceLine.InvoiceID', @.join_unique_key = 0
> GO
> -- Adding the article subset filter
> exec sp_addmergefilter @.publication = N'eBreathe_Publication', @.article =
> N'InvoiceHeader', @.filtername = N'InvoiceHeader_Customers',
> @.join_articlename = N'Customers', @.join_filterclause =
> N'Customers.CustomerCode = InvoiceHeader.CustomerCode', @.join_unique_key =
0
> GO
>
>
>

Sunday, February 12, 2012

Collection cannot be modified when TextMode has been set (Microsoft.SqlServer.Smo)

Hi -

I'm trying to generate a script for User Defined Functions and I get this error:

Generate Script Progress

- Determining objects in database 'MyDBName' that will be scripted. (Success)
Messages
* Prefetch objects failed for Database 'MyDBName' . (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Prefetch+objects+Database&LinkId=20476

ADDITIONAL INFORMATION:
Collection cannot be modified when TextMode has been set (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.CollectionCannotBeModified&LinkId=20476

I'm using SQL 2005 - with SP1.

Any suggestion what am I missing....

Rakesh

Are you able to generate scripts for these objects using Management Studio? If so, then the problem is with your code, and it would be helpful if you could post the code to see your logic. If not, then there's a problem with your server.

Collection cannot be modified when TextMode has been set (Microsoft.SqlServer.Smo)

Hi -

I'm trying to generate a script for User Defined Functions and I get this error:

Generate Script Progress

- Determining objects in database 'MyDBName' that will be scripted. (Success)
Messages
* Prefetch objects failed for Database 'MyDBName' . (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Prefetch+objects+Database&LinkId=20476

ADDITIONAL INFORMATION:
Collection cannot be modified when TextMode has been set (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.CollectionCannotBeModified&LinkId=20476

I'm using SQL 2005 - with SP1.

Any suggestion what am I missing....

Rakesh

Are you able to generate scripts for these objects using Management Studio? If so, then the problem is with your code, and it would be helpful if you could post the code to see your logic. If not, then there's a problem with your server.