SQL Server has encountered a database availability error: Msg 17207
<Details>
<Content>Msg 17207 was logged in the Windows Application Event Log. This error can indicate a problem with database availability. This error is generated by SQL Server when a problem exists while opening up a secondary data file, transaction log, or filestream file associated with the database. The database will not be online and will have a state of RECOVERY_PENDING.
You can correct this problem by resolving the associated operating system error. Then attempt to bring the database back online through ALTER DATABASE. See the information collected below for the context for which this error was detected.
</Content>
<CollectedInformation>
<Info>
<Name>Database file reported for this error</Name>
<Value>{0}</Value>
</Info>
<Info>
<Name>Operating system error reported</Name>
<Value>{1}</Value>
</Info>
</CollectedInformation>
</Details>
Dim databaseFile
databaseFile = oArgs(3)
Call oBag.AddValue("DatabaseFile", databaseFile)
Dim strFCB
strFCB = oArgs(4)
'now run query to determine database files
Dim connString
connString = "Provider=SQLOLEDB;Data Source=" + sqlInstance + "; Initial Catalog=master;Integrated Security=SSPI"
Dim oConnection
Set oConnection = CreateObject("ADODB.Connection")
oConnection.Open connString
Dim query
' Note: In VBScript, you use ? to pass parameters.
query = "select physical_name from sys.master_files where database_id = ? and physical_name like ? "
Dim oCommand
Set oCommand = CreateObject("ADODB.Command")
oCommand.CommandText = query
oCommand.CommandType = 1 'adCmdText
Dim oResults
Set oResults = oCommand.Execute(query)
If NOT oResults.EOF And strFCB <> "FCB::RemoveAlternateStreams" Then
Call oBag.AddValue("FileMatch", "Yes")
Else
Call oBag.AddValue("FileMatch", "No")
End If