Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Get  a  List  of  All  the  Databases  on  a  SQL  Server  Computer  

 Content of Get a List of All the Databases on a SQL Server Computer.vbs
MD5 Hash: 08D0F7F39E1B227B39BBA37AB840A2A9
strComputer = "atl-ds-01"

Set objConnection = CreateObject("ADODB.Connection")

objConnection.Open _
"Provider=SQLOLEDB;Data Source=" & strComputer & ";" & _
"Trusted_Connection=Yes;Initial Catalog=Master"

Set objRecordset = objConnection.Execute("Select Name From SysDatabases")

If objRecordset.Recordcount = 0 Then
Wscript.Echo "No databases could be found."
Else
Do Until objRecordset.EOF
Wscript.Echo objRecordset.Fields("Name")
objRecordset.MoveNext
Loop
End If



   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a