SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 trigger to keep tables matching
 New Topic  Reply to Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

rockmoose
SQL Natt Alfen

Sweden
3279 Posts

Posted - 09/21/2004 :  11:54:02  Show Profile  Reply with Quote
Way to go Brett!
you are hired to take care of all my transactional replication tasks henceforth

The delete would still blow up the db if there were fk's right ?

/rockmoose
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 09/21/2004 :  13:12:13  Show Profile  Reply with Quote
Sure, no miracles.....

Unless you add CASCADE in to the mix....

And like I said...I've NEVER had to do this...bi-directional can be suspect at best....

Imagine 2 users with 2 differnet set of directions (say it ain't so..that could never happen)

They could sit there all day with a puzzled look on their face....

Why not just point everyone to the same table?



Brett

8-)
Go to Top of Page

rockmoose
SQL Natt Alfen

Sweden
3279 Posts

Posted - 09/21/2004 :  15:03:43  Show Profile  Reply with Quote
I still like the view approach...

I Forgot about CASCADE, that would complete the solution,
imagine playing a malicious user in one database and watch the stupefied faces of the users in the other db :)

Can you write tri-directional triggers as well

rockmoose
/* Chaos is the nature of things...Order is a lesser state of chaos */
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 09/21/2004 :  15:07:24  Show Profile  Reply with Quote
quote:
Originally posted by rockmoose

Can you write tri-directional triggers as well



Sure....I've been known to be quite foolish....



Brett

8-)
Go to Top of Page

influent
Constraint Violating Yak Guru

USA
367 Posts

Posted - 09/21/2004 :  15:41:36  Show Profile  Reply with Quote
This is out of control! :)

If not for a cross-database permissions problem, I'd have everything working great, but I freely admit that the way I'm doing it is not ideal for most situations. If my company were much larger and everything were on a much larger scale, I certainly would reconsider the bidirectional trigger solution. Thanks again all, and may the Norse be with you, always.
Go to Top of Page

rockmoose
SQL Natt Alfen

Sweden
3279 Posts

Posted - 09/21/2004 :  16:15:03  Show Profile  Reply with Quote
You are welcome influent, hopefully we have been of some help...
and you have not been overly frustrated by everything :)

/rockmoose
Go to Top of Page

jen
Flowing Fount of Yak Knowledge

Sweden
4110 Posts

Posted - 09/21/2004 :  23:29:49  Show Profile  Send jen a Yahoo! Message  Reply with Quote
wait hold on...your problem is cross database permissions? how is this?

are you using application roles?
Go to Top of Page

emeriqus
Starting Member

2 Posts

Posted - 12/21/2004 :  08:16:31  Show Profile  Visit emeriqus's Homepage  Reply with Quote
You should use

IF (SELECT TRIGGER_NESTLEVEL()) = 1

instead of

IF @@NESTLEVEL > 1
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000