General discussion

Locked

SQL server 7 trigger

By gibs42 ·
how can I enforce a trigger created in a table in database X, and the affected table will be in database Y..

This conversation is currently closed to new comments.

9 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

SQL server 7 trigger

by pVp In reply to SQL server 7 trigger

Your question is a bit terse, but...

If you're trying to verify x.table against y.table, the trigger on x.table can do that easily.

If you're trying to ensure the integrity of y.table, you need a trigger (maybe even the same one, or with minorchanges) on y.table.

Remember, triggers are invoked by *attempted* operations on a table, and operations on y.table will not invoke the trigger on x.table *unless* y.table has a trigger that (a) invokes the x.table trigger or (b) does some operation on x.table.

Collapse -

SQL server 7 trigger

by gibs42 In reply to SQL server 7 trigger

The question was auto-closed by TechRepublic

Collapse -

SQL server 7 trigger

by roc180 In reply to SQL server 7 trigger

I think you want to know how to cross databases. If thats the case in your database X table x1 trigger code make sure you fully qualify the table y1 in database Y. To fully qualify table y1 use the syntax Y.dbo.y1 in your SQL. If Y is on a different server you will also have to include the server name or its alias.

Neal Martinelli

Collapse -

SQL server 7 trigger

by gibs42 In reply to SQL server 7 trigger

The question was auto-closed by TechRepublic

Collapse -

SQL server 7 trigger

by john_bosko In reply to SQL server 7 trigger

while creating a trigger on a table in the database X please specify a stored procedure that would go and do the affect in another tabee in database Y.

Collapse -

SQL server 7 trigger

by gibs42 In reply to SQL server 7 trigger

The question was auto-closed by TechRepublic

Collapse -

SQL server 7 trigger

by ohJani In reply to SQL server 7 trigger

In your trigger, replace the database Y name to
<SQLServer Name>.<Database Y Name>.dbo.<Table Name in Database Y>

Collapse -

SQL server 7 trigger

by gibs42 In reply to SQL server 7 trigger

The question was auto-closed by TechRepublic

Collapse -

SQL server 7 trigger

by gibs42 In reply to SQL server 7 trigger

This question was auto closed due to inactivity

Back to Networks Forum
9 total posts (Page 1 of 1)  

Related Discussions

Related Forums