Windows Scripting Host

If the command prompt and Windows PowerShell are not enough for you, the Windows Scripting Host (WSH) engine may do the trick. It is beyond the scope of this book to attempt a tackle of WSH in its entirety, but Microsoft's website is filled with valuable information about WSH and scripting options. This section will provide one example with some comments, but it won't try to teach you WSH scripting here because that is a multi-hundred-page topic by itself.

The following example code can be saved to a file, such as checkspace.vbs, and executed:

strServerName = "." strDBName = "AdventureWorks" Set objSQLSrv = CreateObject("SQLDMO.SQLServer") objSQLSrv.LoginSecure = True objSQLSrv.Connect strServerName Set objDB = objSQLServer.Databases(strDBName) ...

Get SQL Server® 2008 Administration: Real World Skills for MCITP Certification and Beyond now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.