Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Get a List of All the Databases on a SQL Server ComputerContent of Get a List of All the Databases on a SQL Server Computer.vbsMD5 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 :: |