tags:

views:

57

answers:

3

I had inherited this SQL Server where we put data in a table (Call TableA) on a database (DB-A). I can see the tableA in another database on the same server ( DB-B) gets the same data right away.

Any ideas how this is implemented? I am trying to see the trace but so far no luck. Any one has an idea?

At this stage I am not sure if its replication. This is a guess

+1  A: 

Perhaps it is transactional replication? You should be able to go to the replication are and see if there are subscribers or publishers. Either that or you have linked servers, and triggers are copying the data.

Jeremy
The two databases are on the same machine. I dont see a trigger writing to another database. Any way I can monitor the writes to a particluar table?
schar
You create a profiler trace and filter it on the destination database. If you output the results to a table, you can run sql queries over the results to at least see when the writes are happening.For replication...which version of sql server are you using? In 2k5 and above there is a Replication folder under the server node. Open that and expand any nodes looking for publications or subscriptions.
Jeremy
Found that a stored procedure from the database A was writing to database B as well. The profiler never caught that write statement from the stored procedure call.Thank you for your suggestion
schar
with the profiler, you can catch certain events, so be sure to have the right events selected or sp calls can be ignored. just something for future.
Jeremy
+1  A: 

It could be replication or it could be a trigger on the source table that is moving the data over.

Randy Minder
The profiler failed to catch the write by a stored proc from the database A. So the profiler was sitting idle and i saw the table getting updated. Found the cause. Thanks for the help
schar
+1  A: 

This is most likely happening by use of either a synonym or cross-database view. Check to see if the "table" on the other database really is a table. If it IS a table, then they've set up transactional replication between the two databases.

select type_desc from sys.objects where name = 'name_on_database_b' 
Dave Markle
How do i check if they are set as transactional replication?
schar
The profiler failed to catch the write by a stored proc from the database A. So the profiler was sitting idle and i saw the table getting updated. Found the cause. Thanks for the help
schar