Returning current table name to a trigger

  • Dave: If it wasn't meant as an insult, then I apologise unreservedly. It certainly felt insulting yesterday, insinuating my work coleagues are Turkeys.

    Frank: (Implication of personal stupidity....) Same goes.

    I understand the basis of these forums and understand constructive criticism.

    Anyone who doesn't take the advice of others, some wiser, others not - especially when it's freely offered, is certainly a fool. They need to evaluate the advice and decide which road to travel on their own. You are right, it's my nose and if necessary - I will bloody it.

    The point I was trying to make was really, a question is asked - offer advice, excellent - point at articles / reference material for or against, excellent. To drop (what I apparently mis-interpreted as) a snide comment or a negative 'give up', without any qualifying reason or any of the above to justify your comments is not good.

    One thing I did find quite strange was that relative newcomers (< 100 posts) to the forums were more positive and offered answers / possible solutions - with only one exception. But people with 'time in' (> 100 posts), were very negative, offering very little towards a solution.

    Frank: - "Why do you ask a question anyway, when you don't want to hear opinion that don't suit you? - As stated earlier, I have no problem taking on board your opinion or anyone elses for that matter, just because we didn't immediately give up on the dynamic route doesn't mean that I can't hear all the people who have had bad experiences of it, screaming 'don't do it'.

    Just as an aside - The original posting was not wether or not we should be going down the dynamic route, it was just - can I get the current table name in a trigger without knowing it beforehand. Which has now been solved with great Thanks to AKM and Shane.

    Final word - No problems with anyone extracting the urine out of the auto-signature - providing there is at least a little of something constructive, positive or negative, in the post......

     

    Steve

    We need men who can dream of things that never were.

  • Steve,

    It certainly was not meant as an insult and I would never intentionally post such things on a forum. If my attempt at humour did upset you then I apologise.

    I must admit that posts that state disagreement without any explanation can be frustrating and sometimes not helpful but some posts are like that, people are just trying to be honest.

    For the most part people do post agreement/disagreement with methods with appropriate explanations and/or samples.

    If you want to use cursors / dynamic sql or the like then that is your prerogative and if people give you possible solutions all the better. I use whatever works with acceptable performance.

    I am glad that someone was able to help you  since I was not able.

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Steve,

    I will bloody it.

    That's a good attitude, I think. I'm very combative myself when I know I'm right and when I think it yields some good results. However, if I were to run against the Chinese wall, I would certainly revise my strategy more than once.

    One thing I did find quite strange was that relative newcomers (< 100 posts) to the forums were more positive and offered answers / possible solutions - with only one exception. But people with 'time in' (> 100 posts), were very negative, offering very little towards a solution.

    Probably because member with a higher postcount have seen more often such questions. Almost each day you'll find some of them in online communities. Note, that doesn't imply that postcount is of any meaning (to me anyway)!

    Frank: - "Why do you ask a question anyway, when you don't want to hear opinion that don't suit you? - As stated earlier, I have no problem taking on board your opinion or anyone elses for that matter, just because we didn't immediately give up on the dynamic route doesn't mean that I can't hear all the people who have had bad experiences of it, screaming 'don't do it'.

    When you have search the archives as I told you, you surely have found countless posts and their respective answer on dynamic SQL. In most cases you read that dynamic SQL is the second winner in such cases. So when those countless posters before you got a bleeding nose, what is the likelihood that this time the wall will break instead of your nose? Well, I would guess it is infinitesimal small. Almost 0. But then again its your nose, not mine. You already have read The curse and blessings of... by Erland Sommarskog. Just in case you haven't done so yet, you should also read his article on Dynamic search conditions. It might offer a better insight, why to avoid dynamic SQL. But it also show when ans where to use dynamic SQL. Yes, there are situations where this is a clear winner.

    Good luck with your approach and see you again here with other questions!

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

Viewing 3 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply