Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Programatically created Replication won't open

Author  Topic 

mattt
Posting Yak Master

194 Posts

Posted - 2011-02-11 : 06:05:31
Hi,

I've got a bunch of c# code that's supposed to create a replication subscription on the fly, from scratch. It mostly seems to work - certainly it sets up a distribution DB, a publication object and a subscription object under that.

However the subscription object it creates does not seem to behave properly. If I right-click on it in SQL Server Management Studio and select properties I get the error:

SQL Server is unable to complete the operation.

An error occurred while attempting to access the subscription. (Subscription Properties)

The subscription does not exist or you do not have sufficient privileges to access the subscription. (Subscription Properties)


Trying to get synchronization status yields:


SQL Server is unable to complete the operation.

An error occurred while attempting to access the subscription. (View Synchronization Status)


The subscription does not exist. (View Synchronization Status)


And finally if I try to re-initialize:

Microsoft SQL Server Management Studio could not reinitialize subscription '.\SQLEXPRESS2:Cache'.

SQL Server replication requires the actual server name to make a connection to the server. Connections through a server alias, IP address, or any other alternate name are not supported. Specify the actual server name, 'MY_MACHINE_NAME\SQLEXPRESS'. (Replication.Utilities)


I'm not terribly familiar with replication - just trying to debug something a previous developer left behind. Can anyone help me by letting me know what's wrong with this subscription (it apparently doesn't exist, even though there's a node for it in Management Studio) and/or how I can go about finding out what's wrong with it?

Cheers,
Matt



Lumbago
Norsk Yak Master

3271 Posts

Posted - 2011-02-11 : 06:37:08
I don't really have an answer to your question but all the wizards in SSMS have a button where you can either see the script that is actually executed or you can save the script to a file instead of executing it. You should go through these and see what actually goes on when you create subscriptions/publications.

- Lumbago
My blog-> http://thefirstsql.com/2011/02/07/regular-expressions-advanced-string-matching-and-new-split-function-sql-server-2008-r2/
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-02-11 : 10:33:42
Would need to see the SQL executed by the application to say what got missed.
Go to Top of Page
   

- Advertisement -