Retrieving an SMO Object by Name

  • Yeah, I realize that sysobjects doesn't contain everything. I'll probably end up going the similar route of writing a bunch of custom queries, but for now I'm trying to keep it as simple as possible.

    The issue with the parents is that even if you know the object name and type, that's not enough to lookup via URN. For example, if you want to retrieve the object for a trigger, you have to know the trigger's table name, since the URN accesses the trigger via that table.

  • Ah, okay. I suppose that didn't come up for me because I was using them for scripting and I just used the "dependent objects" trick to get them.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

Viewing 2 posts - 16 through 16 (of 16 total)

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