Thursday, March 22, 2012
adding user-defined data type to existing publication/subscription
I have a database which already has a publication set up, which sends a
bunch of tables to subscribers. Everything was okay, but now I need to
publish two more tables. These tables contain columns which are user
defined types, which means my subscribers do not have them defined on
their side.
When I try to start synchronizing I get an error: Column or parameter
#1: Cannot find data type u_Blah. (error number 2715)
which is I guess, fair enough since the tables is trying to call
something that doesn't exist for the subscribers yet. If I understand
MSDN correctly (I tried reading so many articles...) in the Publication
--> Properties --> Articles tab; then, when I go into the properties
of the new articles, I can specify "Convert User Defined To base data
types", and then the subscribers will be able to pick up the user
defined types just fine. However (PLEASE tell me I understood this
wrong) that only works when publication is being set up the very first
time. That, in my situation, because I'm only adding articles, I cannot
do that.
The solution in MSDN seems to be to "manually copy the type (and the
associated assembly for a user-defined type) to each subscriber".
(msdn2.microsoft.com/en-us/library/ms152559.aspx) I have no idea what
this means. Can anyone shed some light on what must be done now?
Thank you
-Dorothy
This is definable at the article level, and if you select to use the base
types for your new articles, there should be no requirement to have them
exist on the subscriber. If you want to continue to use user-defined data
types, you can create a script to add them (using sp_addtype and operating
in the correct database ie a 'USE' statement at the top) and then run this
script on the subscriber. How to do this? There are several options:
(a) manually open up Query Analyser and connect to the subscriber and then
run there
(b) use a pre-snapshot script on the publication - not for you as you are
just adding articles to an initialized publication
(c) use sp_addscriptexec, which will run the script on the subscriber the
next time it synchronizes
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||Just to clarify the current situation:
1) SQL2005 snapshot processing can handle column dependencies on
user-defined data types (both TSQL and CLR) by including the necessary
type\assembly definitions as part of the snapshot. There should be no need
to manually create the necessary types at the subscriber ahead of time using
a pre-snapshot script anymore as folks typically need to do on SQL2000.
2) SQL2005 DDL replication currently lacks capability to figure out new data
type dependencies introduced by a DDL action (such as adding a new column
depending on a UDT that doesn't exist at the subscriber as you attempted
below) As such, you would need to implement some other mechanisms
(sp_addexecscript being one) to bring the necessary data type (+assembly)
definition over to the subscriber before the DDL action is replicated.
-Raymond
<dorothyy@.eyi.us> wrote in message
news:1159311634.662309.166020@.d34g2000cwd.googlegr oups.com...
> Hello, I am not a sql server programmer.
> I have a database which already has a publication set up, which sends a
> bunch of tables to subscribers. Everything was okay, but now I need to
> publish two more tables. These tables contain columns which are user
> defined types, which means my subscribers do not have them defined on
> their side.
> When I try to start synchronizing I get an error: Column or parameter
> #1: Cannot find data type u_Blah. (error number 2715)
> which is I guess, fair enough since the tables is trying to call
> something that doesn't exist for the subscribers yet. If I understand
> MSDN correctly (I tried reading so many articles...) in the Publication
> --> Properties --> Articles tab; then, when I go into the properties
> of the new articles, I can specify "Convert User Defined To base data
> types", and then the subscribers will be able to pick up the user
> defined types just fine. However (PLEASE tell me I understood this
> wrong) that only works when publication is being set up the very first
> time. That, in my situation, because I'm only adding articles, I cannot
> do that.
> The solution in MSDN seems to be to "manually copy the type (and the
> associated assembly for a user-defined type) to each subscriber".
> (msdn2.microsoft.com/en-us/library/ms152559.aspx) I have no idea what
> this means. Can anyone shed some light on what must be done now?
> Thank you
> -Dorothy
>
|||Hello,
thread has been moved to here mysteriously.
http://groups.google.com/group/micro...65417554cc611c
thank you
Raymond Mak [MSFT] wrote:[vbcol=seagreen]
> Just to clarify the current situation:
> 1) SQL2005 snapshot processing can handle column dependencies on
> user-defined data types (both TSQL and CLR) by including the necessary
> type\assembly definitions as part of the snapshot. There should be no need
> to manually create the necessary types at the subscriber ahead of time using
> a pre-snapshot script anymore as folks typically need to do on SQL2000.
> 2) SQL2005 DDL replication currently lacks capability to figure out new data
> type dependencies introduced by a DDL action (such as adding a new column
> depending on a UDT that doesn't exist at the subscriber as you attempted
> below) As such, you would need to implement some other mechanisms
> (sp_addexecscript being one) to bring the necessary data type (+assembly)
> definition over to the subscriber before the DDL action is replicated.
> -Raymond
> <dorothyy@.eyi.us> wrote in message
> news:1159311634.662309.166020@.d34g2000cwd.googlegr oups.com...
Tuesday, March 20, 2012
adding subscriptions
Hi everyone,
Im not into VB scripting...On SSNS, im trying to add subscribers and subscriptions using VBscript.
I have been successful in adding subscribers but am getting an error while trying to add subscriptions... here's my code and the error:
PS: the tutorial code doesnt help much though it is very very similar, coz it is throwing up its own errors.
'
' AddSubscriptions.vbs
'
' Add a set of subscriptions to the ********** application
'
AddSubscriptions
Function AddSubscriptions()
Dim nsInstance, nsApplication, nsSubscription
' Create NSInstance object
Set nsInstance =
WScript.CreateObject("Microsoft.SqlServer.NotificationServices.NSInstance")
nsInstance.Initialize "*******"
' Create NSApplication object
Set nsApplication =
WScript.CreateObject("Microsoft.SqlServer.NotificationServices.NSApplication")
nsApplication.Initialize (nsInstance), "**********"
' Create NSSubscription object
Set nsSubscription =
WScript.CreateObject("Microsoft.SqlServer.NotificationServices.Subscription")
nsSubscription.Initialize (nsApplication), "**********Subscriptions"
' Set common properties for all subscribers
nsSubscription.SetFieldValue "DeviceName", "myDevice"
nsSubscription.SetFieldValue "SubscriberLocale", "en-us"
' Add subscriptions
nsSubscription.SubscriberId = "******"
nsSubscription.SetFieldValue "City", "*********"
nsSubscription.Add
nsSubscription.SubscriberId = "*****"
nsSubscription.SetFieldValue "City", "*********"
nsSubscription.Add
nsSubscription.SubscriberId = "***********"
nsSubscription.SetFieldValue "City", "*********"
nsSubscription.Add
wscript.echo "Subscriptions successfully added."
End Function
ERROR MESSAGE:
Line: 25
Char: 2
Error: Specified argument was out of range of valid values.
Parameter name: subscriptionClassName
Code: 80131502
Source: MicrosoftSqlServer.NotificationServices
any help will be much appreciated!
cheers,
Sunny
Hard to tell but it looks like you may have a typo in your subscription class name.
BTW - I recently blogged about deleting subscribers using VBScript; it's not exactly what you're trying to do, but perhaps it'll help.
http://sqlns.blogspot.com/2006/04/deleting-sqlns-v20-subscribers-using.html
And here's a link to a blog where I describe how to create subscribers, devices, and subscriptions in C#.
http://sqlns.blogspot.com/2005/09/creating-subscribers-in-v20.html
HTH..
Joe
adding subscriptions
Hi everyone,
Im not into VB scripting...On SSNS, im trying to add subscribers and subscriptions using VBscript.
I have been successful in adding subscribers but am getting an error while trying to add subscriptions... here's my code and the error:
PS: the tutorial code doesnt help much though it is very very similar, coz it is throwing up its own errors.
'
' AddSubscriptions.vbs
'
' Add a set of subscriptions to the ********** application
'
AddSubscriptions
Function AddSubscriptions()
Dim nsInstance, nsApplication, nsSubscription
' Create NSInstance object
Set nsInstance =
WScript.CreateObject("Microsoft.SqlServer.NotificationServices.NSInstance")
nsInstance.Initialize "*******"
' Create NSApplication object
Set nsApplication =
WScript.CreateObject("Microsoft.SqlServer.NotificationServices.NSApplication")
nsApplication.Initialize (nsInstance), "**********"
' Create NSSubscription object
Set nsSubscription =
WScript.CreateObject("Microsoft.SqlServer.NotificationServices.Subscription")
nsSubscription.Initialize (nsApplication), "**********Subscriptions"
' Set common properties for all subscribers
nsSubscription.SetFieldValue "DeviceName", "myDevice"
nsSubscription.SetFieldValue "SubscriberLocale", "en-us"
' Add subscriptions
nsSubscription.SubscriberId = "******"
nsSubscription.SetFieldValue "City", "*********"
nsSubscription.Add
nsSubscription.SubscriberId = "*****"
nsSubscription.SetFieldValue "City", "*********"
nsSubscription.Add
nsSubscription.SubscriberId = "***********"
nsSubscription.SetFieldValue "City", "*********"
nsSubscription.Add
wscript.echo "Subscriptions successfully added."
End Function
ERROR MESSAGE:
Line: 25
Char: 2
Error: Specified argument was out of range of valid values.
Parameter name: subscriptionClassName
Code: 80131502
Source: MicrosoftSqlServer.NotificationServices
any help will be much appreciated!
cheers,
Sunny
Hard to tell but it looks like you may have a typo in your subscription class name.
BTW - I recently blogged about deleting subscribers using VBScript; it's not exactly what you're trying to do, but perhaps it'll help.
http://sqlns.blogspot.com/2006/04/deleting-sqlns-v20-subscribers-using.html
And here's a link to a blog where I describe how to create subscribers, devices, and subscriptions in C#.
http://sqlns.blogspot.com/2005/09/creating-subscribers-in-v20.html
HTH..
Joe
Thursday, March 8, 2012
Adding new subscribers to a publisher
The snapshot on our publisher has a 180 day retention period. We are able
to add new subscribers just fine within that 180 days, but it seems that come
day 181 when we add a new subscriber it is missing a bunch of schema
information that it should be getting from the snapshot.
All the MS documentation on the retention setting points to keeping current
subscribers active and says nothing about are correlation to new subscribers.
I was wondering if there is relation between the retention setting and when
you can add new subscribers. Does anyone know? Thanks!
I got some more info yesterday from one of the logs. Turns out that the
snapshot is being marked as obsolete. From what I've read the only way a
snapshot can be marked as obsolete is by running one of the following:
sp_addmergearticle
sp_changemergearticle
sp_mergecleanupmetadata
We have not run any of these stored procedures, nor have we modified the
schema in any other way. So at this point it looks like the snapshot is
being marked as obsolete as soon as the retention period has passed. Does
this sound right?
"Paul Ibison" wrote:
> Ben,
> are you saying that a new snapshot doesn't have the same schema as the
> existing subscribers? What things are not being snapshotted, and is the
> snapshot definitely recent?
> Cheers,
> Paul Ibison
>
>
|||I just want to make sure I'm understanding this right. So if our retention
period is set to the default of 14 days and we set up a new snapshot on
7/1/07 then we have to make sure we get all of our subscribers added to the
publisher by 7/14/07 since we cannot add any new subscribers after 7/15/07.
Is this right?
The problem is that we will continuously be adding new subscribers one week
from now, one month from now and a couple years from now. So is our only
option then to lengthen the retention period to something like 1800 days
(around 5 years) and deal with the fact that our database will be storing a
ton of metadata?
Thanks,
Ben
"Paul Ibison" wrote:
> This sounds fine to me - once the retention period is reached, the required
> changes aren't there to make the snapshot data upto date.
> Cheers,
> Paul Ibison
>
>
|||Thanks Paul,
Our experience with running the snapshot agent is that all current
subscribers have to be resyncronized which with the publisher which is a lot
of work when you have a bunch of subscribers. Maybe we are not utilizing
something that would allow this to task to be less of a headache. If you
know of any documentation that may help us in this area it would be much
appreciated. Thanks!
-Ben Fyvie
"Paul Ibison" wrote:
> Correct ... or run the snapshot agent more frequently.
> HTH,
> Paul Ibison
>
>
Monday, February 13, 2012
Adding columns during replication
replication.
I have one publisher with many subscribers and I don't want to delete all
the subscriptions to add columns to my publisher.
If this is not the correct way to add columns could you please explain how I
should do it correctly.
Thank you
Abdul,
have a look at sp_repladdcolumn.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Paul, as always thank you for your help
"Paul Ibison" wrote:
> Abdul,
> have a look at sp_repladdcolumn.
> Rgds,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>
Adding column to article on *susbcriber* side
I've got a unidirectional transactional replication (on sql 2000) and
I want to add a column to a table on the subscriber's side, the column
allows nulls and is going to be updated on the subscriber.
I thought of creating the table, than adding the publication and when
I add this specific article, tell it to truncate the table if it
exists rather than to drop it.
Is there any flaw in this?
Thanks in advance,
R. Green
It should work. This is the normal way of carrying out what you are trying
to accomplish.
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
"Ronald Green" <zzzbla@.gmail.com> wrote in message
news:1172407317.380240.255030@.t69g2000cwt.googlegr oups.com...
> Hi,
> I've got a unidirectional transactional replication (on sql 2000) and
> I want to add a column to a table on the subscriber's side, the column
> allows nulls and is going to be updated on the subscriber.
> I thought of creating the table, than adding the publication and when
> I add this specific article, tell it to truncate the table if it
> exists rather than to drop it.
> Is there any flaw in this?
> Thanks in advance,
> R. Green
>
|||Thanks a lot!
On Feb 25, 3:01 pm, "Hilary Cotter" <hilary.cot...@.gmail.com> wrote:
> It should work. This is the normal way of carrying out what you are trying
> to accomplish.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTShttp://www.indexserverfaq.com
> "Ronald Green" <zzz...@.gmail.com> wrote in message
> news:1172407317.380240.255030@.t69g2000cwt.googlegr oups.com...
>
>
>
>
> - Show quoted text -
|||Hi,
I ran a little test, and it failed on delivering the snapshot because
of that extra column on the subscriber side. So the moral of the story
is to add the column in a post snapshot script which is not always the
best idea (if you already have your schema deployed and something is
dependant on this column), OR you can change the SYNC view on the
publisher and add a blank column to it prior to running the snapshot
agent.
R. Green
On Feb 25, 3:01 pm, "Hilary Cotter" <hilary.cot...@.gmail.com> wrote:
> It should work. This is the normal way of carrying out what you are trying
> to accomplish.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTShttp://www.indexserverfaq.com
> "Ronald Green" <zzz...@.gmail.com> wrote in message
> news:1172407317.380240.255030@.t69g2000cwt.googlegr oups.com...
>
>
>
>
> - Show quoted text -
|||Arghhh!!!!!!!!!!!! Somehow I was assuming you would be doing a no-sync.
Yes, this could be accomplished via a post snapshot script.
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
"Ronald Green" <zzzbla@.gmail.com> wrote in message
news:1172412186.310429.11430@.k78g2000cwa.googlegro ups.com...
> Hi,
> I ran a little test, and it failed on delivering the snapshot because
> of that extra column on the subscriber side. So the moral of the story
> is to add the column in a post snapshot script which is not always the
> best idea (if you already have your schema deployed and something is
> dependant on this column), OR you can change the SYNC view on the
> publisher and add a blank column to it prior to running the snapshot
> agent.
> R. Green
>
> On Feb 25, 3:01 pm, "Hilary Cotter" <hilary.cot...@.gmail.com> wrote:
>
Sunday, February 12, 2012
adding article in merge replication
our configuration is SQL 2000 (publisher and subscribers as well), merge
replication, pull subscription.
From time to time we add new subscriber.
I need to add new table or stored procedure into current replication
schema. What to do exactly if I want to avoid reinit with total snapshot
transfer for existing subscriptions and any new subscription should be
created with new articles already?
Is following sequence correct?
EXEC sp_addmergearticle
@.publication = @.our_publication,
@.article = N'newarticle',
... @.force_invalidate_snapshot = 1
EXEC sp_refreshsubscriptions
@.publication = @.our_publication
Thanks for an answer or suggestion.
Lenka
Adding a new merge article to the publication will result in an entire
snapshot being created but NOT a reinitialization. Just the new article will
be transferred. Once the article has been added to the publication, you'll
need to also run the snapshot agent to have it propagated.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .