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

No comments:

Post a Comment