Results 1 to 6 of 6

Thread: Sqldmo

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2002
    Location
    North Carolina
    Posts
    131

    Sqldmo

    Is it possible to script views in SQL 2k using SQLDMO in order of their dependencies? For example, if I have three veiws (A, B, C) and A uses C and C uses B, is it possible to script the views in the order they are used (B, C, A). The default order of scripting appears to be (A, B, C).

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Feb 2002
    Location
    North Carolina
    Posts
    131
    Anyone???

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    You have to figure out the dependency (which can be done using DMO) and script each one in that order. It isn't fun, I tried to do that once, and gave up after about a week trying to get it right (I was scripting tables AND stored procs AND FKeys, etc...)

    TG
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Feb 2002
    Location
    North Carolina
    Posts
    131
    It has been a royal pain in my . . ., well, you get the picture. I can't seem to get the dependencies from DMO. If I can get the dependencies I'm sure I could create a procedure to script them in the order that I need them. Any ideas or suggestions on getting the dependencies from DMO?

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    Let me dig around, I know I've got that code some where. If I can find it, I'll post it.


    Tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  6. #6
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    Crap, I must have killed that proj when I couldn't get it to do what I wanted.... but I have the info you need.

    The View (and View2) object of SQLDMO has a proerty EnumDependancies, which returns an object of QueryResults that you can loop through to see what it's dependant on. According to the help though, this list will also include objects that are dependant on that view. If remember right, there is a type col in the query results which you should be able to use to determine which type of dependancy it is.

    Hope it helps.

    TG
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width