Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Other Technologies / Replication / December 2006

Tip: Looking for answers? Try searching our database.

How to solve a replication agent problem caused by executing sp_addscriptexec ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Josep - 15 Dec 2006 15:03 GMT
I execute a sp_addscriptexec because I wanted to create a trigger, but it
already exists in some of the subscribers. So, I get the following error:
"....\Microsoft SQL
Server\MSSQL$SQLSERVER2000\ReplData\20061213182034400\script_trigger.sql'
could not be propagated to the subscriber."

How can I solve this problem?

The only solution I've found is to go to the directory
"\ReplData\20061213182034400" and modify the file to avoid any error.

I suppose there's a "better" way to do it, but I don't know how :-(

Thank you in advance

Josep.
Hilary Cotter - 15 Dec 2006 15:36 GMT
What do the contents of script_trigger.sql  look like?

Does it have a create trigger statement or an alter trigger statement? You
might have to incorporate some logic to detect the existence of the trigger
and then alter it if it exists or create it if it does not.

Signature

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

>I execute a sp_addscriptexec because I wanted to create a trigger, but it
>already exists in some of the subscribers. So, I get the following error:
[quoted text clipped - 12 lines]
>
> Josep.
Josep - 15 Dec 2006 16:17 GMT
The script was just a CREATE TRIGGER instead of ALTER TRIGGER. But I
realised the mistake after executing the sp_addscriptexec. So I had the
error in the agent. But then how could I solve the agent's error because the
agent is always trying to execute this script. It could be solved
reinitializing the subscribers, but it's not so practical.

Paul Ibison has a stored procedure in his web called spBrowseMergeChanges,
but it tells you only the rows to be merged but not the scripts to be
executed and I don't know how to delete this script pending to be executed
in the subscribers.

Thank you and sorry for my English if it's not clear enough...

Josep.

> What do the contents of script_trigger.sql  look like?
>
[quoted text clipped - 18 lines]
>>
>> Josep.
Hilary Cotter - 15 Dec 2006 21:44 GMT
If it is transactional replication it can be found via using
sp_browsereplcmds and you can delete the row and its related transaction
from msrepl_tranasctions and msrepl_commands. If it is merge replication
IIRC it will be in sysmergeschemachange

Signature

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

> The script was just a CREATE TRIGGER instead of ALTER TRIGGER. But I
> realised the mistake after executing the sp_addscriptexec. So I had the
[quoted text clipped - 33 lines]
>>>
>>> Josep.
Paul Ibison - 27 Dec 2006 20:46 GMT
Alternatively you could locate the script in the distribution working folder
and edit it. I have done this and inserted "select 1" as a valid TSQL script
just to get things working again.
       Cheers,
           Paul Ibison SQL Server MVP, www.replicationanswers.com .
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.