Closed webfly2 closed 3 hours ago
Looks like an unexpected NULL
ended up in the table/view/DMV... and the logic I have to fetch and process the returned result set is tripping over it. I've never observed it...
Just out of curiosity, what do you see if you go straight to T-SQL... and browse around? Or maybe even useing SSMS to see the logs?
Hi @webfly2, from what I can guess this could be an issue in SMO.
Is it possible your SQL Server is configured for a language other than English? I can see that T-SQL fragment (generated by SMO) to return NULL for the CreateDate column when:
I'll log a bug against SMO while I see what I can do to workaround it...
I've applied a workaround and I expect the fix to rollout today (?) with v22.3.
When executing Get-SqlErrorLog -ServerInstance "ServerName" I am getting the following Error:
Get-SqlErrorLog: Unable to cast object of type 'System.DBNull' to type 'System.DateTime'.
Verbose and Debug Output:
I tried this on different SQL Server Hosts with the same output.
The output of $PSVersionTable:
The output of (Get-Module SQLServer).Version:
The version of Sql Server or Azure SQL: SQL Server Version 16.0.1115