Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 123»»»

Question of the Day for 17 Oct 2005 Expand / Collapse
Author
Message
Posted Tuesday, October 11, 2005 2:05 PM
SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Friday, May 18, 2007 3:36 PM
Points: 10,039, Visits: 1
Comments posted to this topic are about the Question of the Day for 17 Oct 2005 posted at http://www.sqlservercentral.com/testcenter/qod.asp?QuestionID=623.
Post #228103
Posted Monday, October 17, 2005 6:49 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Thursday, November 27, 2014 4:23 AM
Points: 20,584, Visits: 9,624
...and that's just the way it should be .
Post #229290
Posted Monday, October 17, 2005 7:13 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Saturday, September 27, 2014 12:26 PM
Points: 676, Visits: 433
Even though I answered correctly, it would have been nice to have had some psuedo code to help out. I had to read through the question a couple of times to understand it, where as psuedo code would have been more direct. It's just the way I learn, I realize everyone is different. Nice Question.


Post #229297
Posted Monday, October 17, 2005 7:25 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Thursday, November 27, 2014 4:23 AM
Points: 20,584, Visits: 9,624
There's still no other possible somewhat right answer... if the trigger fails, the whole transaction has to fail.
Post #229299
Posted Monday, October 17, 2005 10:28 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Wednesday, November 26, 2014 9:53 AM
Points: 3,475, Visits: 584

I answered correctly but I wonder if the answer with "The process works normally but produces an error message" could be implemented? Something like in the trigger text:

Begin Transaction

<update statements>

RAISEERROR (with severety level 1 - informational)

Commit Transaction

I also wonder if the trigger type is  "Instead Of"  could we make the trigger insert rows but produce the message?

Yelena




Regards,
Yelena Varshal

Post #229408
Posted Monday, October 17, 2005 10:47 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Saturday, September 27, 2014 12:26 PM
Points: 676, Visits: 433

I guess it is more a friendly critique of the format of the question. It was a little rough to read through, and having psuedo code would have helped me understand the question more easily. I did not have the answers available at the time as I was reading the question from the email.




Post #229421
Posted Monday, October 17, 2005 2:13 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, July 27, 2010 7:51 PM
Points: 1,244, Visits: 3
I think that total failure was the only right answer

If the WHERE clause used IN or EXISTS that two rows returned from the subquery would not cause a failure or any warning, but certainly if it is a boolean operator expecting a singleton, then it would fail.



Post #229505
Posted Monday, October 17, 2005 11:26 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, December 10, 2014 11:06 AM
Points: 1,113, Visits: 706
I found the whole setup to be somewhat of a red herring. The point is, if the trigger fails everything is going to fail. Doesn't matter if there are foreign keys or not...


--
Adam Machanic
SQL Server MVP
SQLblog.com: THE SQL Server Blog Spot on the Web
Post #229595
Posted Tuesday, October 18, 2005 5:13 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, March 23, 2011 8:43 AM
Points: 145, Visits: 10
The question didn't state that the statement that caused the trigger to fire was running inside a transaction.


Post #229662
Posted Tuesday, October 18, 2005 6:27 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Thursday, November 27, 2014 4:23 AM
Points: 20,584, Visits: 9,624
Doesn't matter. There's always a transaction to rollback if a major error occurs.
Post #229692
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse