May 2010
Intermediate to advanced
815 pages
21h 55m
English
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) ...