I have configured transactional replication between two sql servers 2000 by
wizard, i have one publisher and one subscriber (distributor is on same
server as publisher)
I need to script all part of replication but for installing later and when i
try it it's not successed.
Can somebody provide me what really i need to script on punlisher on
subscriber .... ...... ...
Also if on istallation the servers name will be differen from those that i
did script.
Thanks
Message posted via http://www.droptable.com
The easiest thing to do is to get Enterprise manager to generate the script
for you. One thing I've started doing is running some sqldmo each evening to
produce such textfiles automatically. This way I can be sure to have a
backed up version of my replication settings:
Dim objDMO As SQLServer
Dim objReplication As Replication2
Dim fso As FileSystemObject
Dim ts As TextStream
Dim sFilename As String
Set objDMO = New SQLDMO.SQLServer
Set fso = New FileSystemObject
sDirectoryPath = "c:\"
objDMO.LoginSecure = True
objDMO.Connect "crazyfrog"
Set objReplication = objDMO.Replication
sFilename = sDirectoryPath & objDMO.Name & CStr(Year(Now())) &
CStr(Month(Now())) & CStr(Day(Now())) & ".txt"
Set ts = fso.OpenTextFile(sFilename, ForWriting, True)
ts.Write objReplication.Script(SQLDMORepScript_InstallDistr ibutor Or
SQLDMORepScript_InstallPublisher)
ts.Close
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Thanks Paul, however i got problem with this script, first of all where i
should run this script via DTS?
Please can u explain me in more detail how to use this script
TNX
Message posted via http://www.droptable.com
|||You'd be best running this in a programming environment like VB or VB.NET.
You could also run it in an activex script task, but then you'll have to use
a non object-oriented environment and use variants instead. If you just need
a one-off, then EM is the easiest way to go.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||OK, thanks.
iwould like to perform it via DTS, if i only remove all classes name on
variables define it's not help, can u advice me something,
TNX
Message posted via http://www.droptable.com
|||here you go...
'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************
Function Main()
Dim objDMO
Dim objReplication
Dim fso
Dim tf
Set objDMO = CreateObject("SQLDMO.SQLServer")
Set fso = CreateObject("Scripting.FileSystemObject")
objDMO.LoginSecure = True
objDMO.Connect "crazyfrog"
Set objReplication = objDMO.Replication
Set fso = CreateObject("Scripting.FileSystemObject")
Set tf = fso.CreateTextFile("c:\testfile.txt", True)
tf.Write objReplication.Script(1048576)
tf.Close
Main = DTSTaskExecResult_Success
End Function
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Thanks very usefull, i tried it works perfect.
Message posted via http://www.droptable.com
|||how to perform the script above only for specified publication, e.g. i have
few publishers on one sql server
TNX
Message posted via http://www.droptable.com
|||Have a look here: http://www.replicationanswers.com/script6.asp
You'll have to edit the text in the same way I did to make it use variants.
Rgds,
Paul Ibison, SQL Server MVP
"akej via droptable.com" <forum@.droptable.com> wrote in message
news:5086609F212F0@.droptable.com...
> how to perform the script above only for specified publication, e.g. i
> have
> few publishers on one sql server
> TNX
> --
> Message posted via http://www.droptable.com
|||Thanks in advance
Message posted via http://www.droptable.com
Showing posts with label subscriber. Show all posts
Showing posts with label subscriber. Show all posts
Tuesday, March 20, 2012
Script replication
Labels:
bywizard,
configured,
database,
distributor,
microsoft,
mysql,
oracle,
publisher,
replication,
script,
server,
servers,
sql,
subscriber,
transactional
Tuesday, February 21, 2012
SCOPE_IDENTITY on Subscriber
We are doing immediate updating transactional replication between a
single publisher and a single subscriber.
When we try to select SCOPE_IDENTITY or @.@.IDENTITY on the Subscriber
we always receive NULL as the result. When we call them on the
Publisher we receive the correct value.
We have the Identity fields setup on the Publisher but on the
Subscriber they are only basic data types as described in the SQL
Server books online.
So my question is, is this functionality by design? And if so, how
can we obtain the Identity values of newly inserted records on the
subscriber?
Or should we be receiving the Identity values back on the subscriber
but something configured incorrectly.
Thanks
Joseph Palermo
this sounds correct.
The way it works is that an update/insert/delete which occurs on the
subscriber is first applied on the publisher and then the publisher - so the
publisher sets the identity value.
"Joseph Palermo" <joe.groups@.bigrawr.com> wrote in message
news:3d78705f.0405051554.65b69c62@.posting.google.c om...
> We are doing immediate updating transactional replication between a
> single publisher and a single subscriber.
> When we try to select SCOPE_IDENTITY or @.@.IDENTITY on the Subscriber
> we always receive NULL as the result. When we call them on the
> Publisher we receive the correct value.
> We have the Identity fields setup on the Publisher but on the
> Subscriber they are only basic data types as described in the SQL
> Server books online.
> So my question is, is this functionality by design? And if so, how
> can we obtain the Identity values of newly inserted records on the
> subscriber?
> Or should we be receiving the Identity values back on the subscriber
> but something configured incorrectly.
> Thanks
> Joseph Palermo
|||Also, if you want the identity values to be created on the
subscriber, then you can use queued updating subscribers,
in which case the identity ranges will be managed on each
subscriber separately. This would give you access to the
@.@.identity value (or scope_identity()).
HTH,
Paul Ibison
single publisher and a single subscriber.
When we try to select SCOPE_IDENTITY or @.@.IDENTITY on the Subscriber
we always receive NULL as the result. When we call them on the
Publisher we receive the correct value.
We have the Identity fields setup on the Publisher but on the
Subscriber they are only basic data types as described in the SQL
Server books online.
So my question is, is this functionality by design? And if so, how
can we obtain the Identity values of newly inserted records on the
subscriber?
Or should we be receiving the Identity values back on the subscriber
but something configured incorrectly.
Thanks
Joseph Palermo
this sounds correct.
The way it works is that an update/insert/delete which occurs on the
subscriber is first applied on the publisher and then the publisher - so the
publisher sets the identity value.
"Joseph Palermo" <joe.groups@.bigrawr.com> wrote in message
news:3d78705f.0405051554.65b69c62@.posting.google.c om...
> We are doing immediate updating transactional replication between a
> single publisher and a single subscriber.
> When we try to select SCOPE_IDENTITY or @.@.IDENTITY on the Subscriber
> we always receive NULL as the result. When we call them on the
> Publisher we receive the correct value.
> We have the Identity fields setup on the Publisher but on the
> Subscriber they are only basic data types as described in the SQL
> Server books online.
> So my question is, is this functionality by design? And if so, how
> can we obtain the Identity values of newly inserted records on the
> subscriber?
> Or should we be receiving the Identity values back on the subscriber
> but something configured incorrectly.
> Thanks
> Joseph Palermo
|||Also, if you want the identity values to be created on the
subscriber, then you can use queued updating subscribers,
in which case the identity ranges will be managed on each
subscriber separately. This would give you access to the
@.@.identity value (or scope_identity()).
HTH,
Paul Ibison
Labels:
asingle,
database,
immediate,
microsoft,
mysql,
oracle,
publisher,
replication,
scope_identity,
select,
server,
single,
sql,
subscriber,
transactional,
updating
Subscribe to:
Posts (Atom)