Re: Save as in SQL Server(Backup - Restore)
From: Dan Guzman (guzmanda_at_nospam-online.sbcglobal.net)
Date: 09/30/04
- Next message: Lucas Tam: "Re: Faking a full-text search"
- Previous message: scott: "Cursor or While Loop or neither?"
- In reply to: Lars Grøtteland: "Re: Save as in SQL Server(Backup - Restore)"
- Next in thread: Tibor Karaszi: "Re: Save as in SQL Server(Backup - Restore)"
- Reply: Tibor Karaszi: "Re: Save as in SQL Server(Backup - Restore)"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 30 Sep 2004 08:39:22 -0500
WMI - Windows Management Instrumentation. See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_start_page.asp
for a reference. You can also find a lot of examples with a google search.
Option Explicit
Dim SQL, Results, ServerName
Dim oWin32_LogicalDisks, oWin32_LogicalDisk
ServerName = "MyServer"
'list local disks on remote server
SQL = "SELECT * FROM Win32_LogicalDisk WHERE DriveType = 3"
Set oWin32_LogicalDisks = _
GetObject("winmgmts:{impersonationLevel=impersonate}!//" & _
ServerName & _
"/root/cimv2").ExecQuery(SQL, , 48)
For Each oWin32_LogicalDisk In oWin32_LogicalDisks
Results = Results & _
oWin32_LogicalDisk.Caption & _
vbCrLf
Next
MsgBox(Results)
-- Hope this helps. Dan Guzman SQL Server MVP "Lars Grøtteland" <lars@nospam> wrote in message news:eukWq$upEHA.3688@TK2MSFTNGP09.phx.gbl... > WMI? What's that? > > -- > > > - Lars > > > "Dan Guzman" <guzmanda@nospam-online.sbcglobal.net> wrote in message > news:%237FDQxupEHA.1576@TK2MSFTNGP12.phx.gbl... >> Just be aware that undocumented functionality may change between SQL >> Server versions or service packs so it's a good practice to avoid this in >> production code. >> >> Another method to accomplish the task is with WMI. >> >> -- >> Hope this helps. >> >> Dan Guzman >> SQL Server MVP >> >> "Lars Grøtteland" <lars@nospam> wrote in message >> news:%23hVB3gupEHA.3524@TK2MSFTNGP15.phx.gbl... >>> xp_availablemedia 2 - That's the command I was looking for >>> >>> -- >>> >>> >>> - Lars >>> >>> >>> "Tibor Karaszi" <tibor_please.no.email_karaszi@hotmail.nomail.com> wrote >>> in message news:emrrdOupEHA.644@tk2msftngp13.phx.gbl... >>>> That is no problem. I take it you already know about the RESTORE >>>> command and the MOVE option to the >>>> restore command. >>>> >>>> If you want the user to be able to browse the directory structure on >>>> the server through their SQL >>>> Server connection, then you have to use some undocumented commands. Run >>>> a profiler trace to see how >>>> EM gets the directory structure and use those commands in your own app. >>>> Note that they are >>>> undocumented, use at your own risk... >>>> >>>> -- >>>> Tibor Karaszi, SQL Server MVP >>>> http://www.karaszi.com/sqlserver/default.asp >>>> http://www.solidqualitylearning.com/ >>>> >>>> >>>> "Lars Grøtteland" <lars@nospam> wrote in message >>>> news:Or3bY1rpEHA.592@TK2MSFTNGP11.phx.gbl... >>>>> My problem is to get "Save As" in my application. >>>>> Create a new database and restore one database into the created one, >>>>> and use >>>>> the new one in my app. >>>>> >>>>> >>>>> >>>>> -- >>>>> >>>>> >>>>> - Lars >>>>> >>>>> >>>>> "Tibor Karaszi" <tibor_please.no.email_karaszi@hotmail.nomail.com> >>>>> wrote in >>>>> message news:u8RHZlipEHA.3724@TK2MSFTNGP10.phx.gbl... >>>>> >> Are there any other way around this problem then? >>>>> > >>>>> > Can you explain what the problem is? First it seems you wanted to >>>>> > create >>>>> > database files on a network >>>>> > drive. You can't do that. Then you mentioned SQLNS, which has no >>>>> > relationship with your original >>>>> > problem... >>>>> > >>>>> > -- >>>>> > Tibor Karaszi, SQL Server MVP >>>>> > http://www.karaszi.com/sqlserver/default.asp >>>>> > http://www.solidqualitylearning.com/ >>>>> > >>>>> > >>>>> >>>> >>>> >>> >>> >> >> > >
- Next message: Lucas Tam: "Re: Faking a full-text search"
- Previous message: scott: "Cursor or While Loop or neither?"
- In reply to: Lars Grøtteland: "Re: Save as in SQL Server(Backup - Restore)"
- Next in thread: Tibor Karaszi: "Re: Save as in SQL Server(Backup - Restore)"
- Reply: Tibor Karaszi: "Re: Save as in SQL Server(Backup - Restore)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|