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 .