Running in context of SQL Server

  • I have a basic db-restore app that I want to run on a client, and restore the database on a SQL Server. Is there a way to use DMO to appear to run "in the context of the SQL Server"?

    I am thinking in the same fashion as Ent. Manager. When I click a browse button, I want to be able to look like I am browsing on the Server itself, and not on the client machine.

    thanks in advance.

    MTFBWY...


    MTFBWY...

  • This was removed by the editor as SPAM

  • What are you browsing? If its any db object, it will work that way for whatever server you've connected to.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • Actually, I am wanting to allow the user to click a file browse button to search for their backup file to restore. Also, I need to allow the user to pick the directory the data and log files will reside in.

    It appears there are some functions called 'EnumAvailableMedia' and 'EnumDirectories' that might be what I am looking for.

    Do you know of anywhere that provides a poster, or tree structure of some kind for listing out the available method calls for the SQLDMO library? I am looking for something similar to the .NET Framework posters Microsoft offers.

    thanks

    MTFBWY...


    MTFBWY...

  • Funny you should ask. I put one together last year for a project we did in partnership with Lumigent. Email me your address and I'll send you one.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • That would be great if I could get a copy of your poster. Thanks in advance.

    Am I on the right track with the EmumDirectories and EnumAvailableMedia calls? Do you have or know of any coding examples with what I am trying to do?

    thanks

    MTFBWY...


    MTFBWY...

  • I don't have samples. Give it a shot, if you can't get it, post what you have and we'll work on it together!

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • I think those are at least 2 of the methods on the SQLServer object you need to call. I think the problem you're going to have is how to get the file names within the directories since I don't see a method that returns that query result. Most likely you'll have to create a stored proc that executes a shell command to get a list of files for a particular directory, you should then be able to call this stored proc with the ExecuteWithResults method.

Viewing 8 posts - 1 through 7 (of 7 total)

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