2 DataBases? Yes, 2 DataBases
-
I wish to know if there is any way to create a trigger that runs when a user makes some insert / update / delete action on a table of a database and then add the same values to a table that dwells in another separate database, both Sql-Server. How can I use the table in the external database? is it possible? Thanks.
-
I wish to know if there is any way to create a trigger that runs when a user makes some insert / update / delete action on a table of a database and then add the same values to a table that dwells in another separate database, both Sql-Server. How can I use the table in the external database? is it possible? Thanks.
hi It is possible, just call the tablename like databasename.dbo.tablename
k.ravi sankar
-
I wish to know if there is any way to create a trigger that runs when a user makes some insert / update / delete action on a table of a database and then add the same values to a table that dwells in another separate database, both Sql-Server. How can I use the table in the external database? is it possible? Thanks.
andreumv wrote:
How can I use the table in the external database?
does this mean both databases are not in one server. if so, you need to link both using sp_addlinkedserver check online help for syntax and usage. once after linking you can access the tables like <server>.<database>.<owner>.<table> if both databases are on same then <database>.<owner>.<table> I've used both (in queries/functions/procedures) exceipt in triggers
Regards KP
-
hi It is possible, just call the tablename like databasename.dbo.tablename
k.ravi sankar
-
hi It is possible, just call the tablename like databasename.dbo.tablename
k.ravi sankar