Showing posts with label code. Show all posts
Showing posts with label code. Show all posts

Friday, March 23, 2012

Replication Programming

I am trying to write c# code to automatically setup a configuration.
I am given a database and a list of articles in the database to
publish.
The Generate Sql script function generats some sql which is what i
based my c# program on.
I used sql-dmo to generate TSQL statments to be executed via
ExecuteImmediate.
When I run my program, there is a hand icon showing the database has a
publication.
The publication shows up in the publication folder.
When I use dbo.sysmergeextendedarticlesview it gives the same result
as what the sqldmo object returns in my code.
But when i try to see the articles in the publication properties, It
says "Cannot retrieve Articles from the database"
Anyone know what the problem is?
thanks,
Hananiel
can you post your code?
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Hananiel" <hananiel@.yahoo.com> wrote in message
news:e338e321.0410131347.4a668fd5@.posting.google.c om...
> I am trying to write c# code to automatically setup a configuration.
> I am given a database and a list of articles in the database to
> publish.
> The Generate Sql script function generats some sql which is what i
> based my c# program on.
> I used sql-dmo to generate TSQL statments to be executed via
> ExecuteImmediate.
> When I run my program, there is a hand icon showing the database has a
> publication.
> The publication shows up in the publication folder.
> When I use dbo.sysmergeextendedarticlesview it gives the same result
> as what the sqldmo object returns in my code.
> But when i try to see the articles in the publication properties, It
> says "Cannot retrieve Articles from the database"
> Anyone know what the problem is?
> thanks,
> Hananiel
|||Hilary Thanks!,
I found the problem. There was a table dtproperties which shows up as
a system table in enterprise manager. However its type in sysobjects
is 'U'.
I just added it to a list of files i need to exclude anyway. However i
dont how to prevent such a thing in future.
Whats the easiest way to add a job to a scheduler (I need to add an
immediate job to generate a snapshot once, publisher is setup.
(Merge ActiveX didnt have anything to do with the snapshot generation
and the snapshot activeX gives an error no snapshot or transactional
replication item found)
Thanks,
Hananiel
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message news:<#$LgKWesEHA.2808@.TK2MSFTNGP14.phx.gbl>...[vbcol=seagreen]
> can you post your code?
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
>
> "Hananiel" <hananiel@.yahoo.com> wrote in message
> news:e338e321.0410131347.4a668fd5@.posting.google.c om...
|||Ok I got the snapshot part too!
Thanks,
Hananiel
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message news:<#$LgKWesEHA.2808@.TK2MSFTNGP14.phx.gbl>...[vbcol=seagreen]
> can you post your code?
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
>
> "Hananiel" <hananiel@.yahoo.com> wrote in message
> news:e338e321.0410131347.4a668fd5@.posting.google.c om...

Saturday, February 25, 2012

Replication LogReader

Once i configured the replication throwing the following error on logreader

2007-02-08 16:47:39.641 Status: 0, code: 1007, text: 'Another logreader agent for the subscription(s) is running or the server is working on a previous request by the same agent.'.
2007-02-08 16:47:39.641 Another logreader agent for the subscription(s) is running or the server is working on a previous request by the same agent.
2007-02-08 16:47:39.641 Status: 0, code: 22037, text: 'The last step did not log any message!'.

Please let me know if you have any solutions to fix this issue.

Can you provide more detail about your replication setup?

Gary

|||My guesss is you have two logreader agent jobs running against the same publisher db. Stop one of the jobs, then delete/disable it, you should have only one logreader agent job per published database. If you do not have two jobs, then somehow the logreader agent process when you ran it the first time did not shut down properly. THe safest way to clear this issue is to restart the SQL Server service on the distributor machine.|||

I have multiple publisher and multiple subscriber for same db.when i configure it this way it is thorowing the above error?