hi all, i am new to triggers i have two databases with similar tables . i need to write a trigger such that when data is inserted in to the first database , the trigger should be fired and update the second database with the same data. need help very quickly.........................
If i understand you, you have two typical database same structure and same data Is it true? Any way, the scope of trigger is the same database only , no side effet on other database. can you explain what you need from second database, may we help.
what i need is replication of one db to another db . i am considering two ways for it 1.when ever some event happens on the first db , trigger should be generated to update the same in the second db 2.copy the whole first db to the second db on a scheduled basis. which one do you think would be appropriate solution?
1)if you have sql 2005 Enterprise Edition, you can crate snapshot database (readonly) on the same server you can scedule creating it. 2)If the two database on different servers, you can use snapshot replication (or other type of replication) 3)You can also do replication on the same server (in that case it is used as Publisher, Subscriber and Distributor databases) but that may effect the performance
Still more information is required such as the size of database, number of users and transactions that are happening on this first database including the location of these databases (same server or different server). Having such an information will help us to identify the issue and provide a suggestion that suits your need, in this case replication is best option to consider such a data update between the servers.