SMO vs SQL-DMO

  • He does say 'scripting operations' so I'm assuming he's talking about scripting objects etc..

    Is this what you're referring to, Jeff, when you talk about a T-SQL solution? (String building?)

    I've been pretty underwhelmed with both SQL-DMO and SMO when it comes to scripting and have on occasions used an xml / xsl solution to achieve a more custom result. [/url]

    (but it's not everyone's cup of tea!)

    Regards,

    David.

  • Ninja's_RGR'us (1/28/2009)


    I was subscribed to this thread as well. And Jeff only replied to it because someone else posted another solution a couple minutes before him.

    When replying to a thread, I never checked when the op started the thread, only if I have something valiable to add to it. When someone trolls here from google, the date of the thread and replies have no bearing on helping him towards a solution.

    this is true....but I was only kidding!

  • David McKinney (1/28/2009)


    He does say 'scripting operations' so I'm assuming he's talking about scripting objects etc..

    Is this what you're referring to, Jeff, when you talk about a T-SQL solution? (String building?)

    I've been pretty underwhelmed with both SQL-DMO and SMO when it comes to scripting and have on occasions used an xml / xsl solution to achieve a more custom result. [/url]

    (but it's not everyone's cup of tea!)

    Regards,

    David.

    Sripting objects, doing stuff on the "outside" because they don't know a way to do it "inside" (like the supposedly impossible import I just got done writing at work), whatever. For example, I know lots of folks that will write a script to get file names from a directory... xp_DirTree works just fine and I don't have to go to the wood shed to find the tool. Yeah, I know... "Undocumented features can go away at the next service pack." So can documented ones... look what they did to the very well documented sp_MakeWebTask privs in 2k sp4. WHAM! Suddenly, it needs "SA" privs... broke a hell of a lot of code. Or how about what they did with the {f4} key functionality when they shifted from 2k to 2k5... all gone! Replaced by some POS filter technology in the object tree.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • David McKinney (1/28/2009)


    Ninja's_RGR'us (1/28/2009)


    I was subscribed to this thread as well. And Jeff only replied to it because someone else posted another solution a couple minutes before him.

    When replying to a thread, I never checked when the op started the thread, only if I have something valiable to add to it. When someone trolls here from google, the date of the thread and replies have no bearing on helping him towards a solution.

    this is true....but I was only kidding!

    Heh... me too! I ALWAYS have enough coffee even if I have to chew the grounds. 😛

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Sripting objects, doing stuff on the "outside" because they don't know a way to do it "inside".

    OK...I get you. I immediately thought more of 'script generation' i.e. Create Table etc.. (I hate the script generation in SSMS - hope it's improved in 2K8.)

    And i'm always in admiration of those who use T-SQL to do the 'seemingly impossible', even if personally it often hurts my head too much, and I resort to more conventional means (or delegate!) 😛

  • For example, I know lots of folks that will write a script to get file names from a directory... xp_DirTree works just fine

    Hi Jeff,

    Does this really work for getting a list of files? I can only get a list of subfolders from it. Am I missing a parameter? (My wife says I am.)

    Thanks,

    David.

  • ....found it!

    EXEC master..xp_dirtree 'C:\temp',@depth, @includefiles

    e.g. EXEC master..xp_dirtree 'C:\temp',1,1

Viewing 7 posts - 16 through 21 (of 21 total)

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