Click here to Skip to main content
16,012,468 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi

i create trigger for insert within one database
But i need to create insert trigger for inserting values to the table on one database
it reflect to the same table on another database plz answer quckly

(i m using sql server 2005)

Thanks Regards,
Posted

1 solution

AKAIK you can't create triggers across databases. The tiggers are only valid for the database created in. If you want cross database communication you may want to look into Service Broker
 
Share this answer
 
Comments
gopi1987 17-Apr-12 9:37am    
i think you mean that diff provider like access,sql,
i know its not possible to create trigger for diff provider.

i dont want this
i need to know, i have two databases and a table placed in both the databases
now i insert a record to one table first database,the trigger insert the same record to same table placed in second database,

please if you know send the code

Thanks and Regards,
[no name] 17-Apr-12 18:35pm    
Don't ask for anyone to send you code. It's rude and shows no effort on your part.

No I don't mean different providers. You cannot create a trigger in one database the works on another database on the server or instance. If you think about it you would understand why. As I said, Service Broker is available with SQL Server. I would suggest you do some research.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900