Error:SqlDateTime overflow when loading SQLLite file into an analyis DB
HenkvdValk-FullData opened this issue · 0 comments
When trying to load a sqllite file into an analysis sql baseline scheme, we hit an datetime datatype conversion error:
(When running in debug mode , sometimes the code works)
It looks like a threading issue on intervalTime not being set correctly :
cmd.Parameters.AddWithValue("@end_time", intervalTime);
2021-06-17 08:36:34.1857 - Info - SqlWorkload.Program : Reading configuration from 'c:\temp\scratch\Load_SQLLiteDB.json'
2021-06-17 08:36:34.5754 - Info - WorkloadTools.Listener.File.FileWorkloadListener : The source file contains 158 events.
2021-06-17 08:36:34.5754 - Info - WorkloadTools.WorkloadController : Listener of type FileWorkloadListener initialized correctly. Waiting for events.
2021-06-17 08:36:34.6981 - Info - SqlWorkload.Program : Controller stopped.
2021-06-17 08:36:34.9923 - Error - SqlWorkload.Program : System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
at System.Data.SqlClient.TdsParser.TdsExecuteRPC(SqlCommand cmd, _SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc, Boolean sync, TaskCompletionSource1 completion, Int32 startRpc, Int32 startParam) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource
1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at WorkloadTools.Consumer.Analysis.WorkloadAnalyzer.CreateInterval(SqlConnection conn, SqlTransaction tran, DateTime intervalTime) in D:\Github\WorkloadTools-master\WorkloadTools\Consumer\Analysis\WorkloadAnalyzer.cs:line 800
at WorkloadTools.Consumer.Analysis.WorkloadAnalyzer.WriteToServer(DateTime intervalTime) in D:\Github\WorkloadTools-master\WorkloadTools\Consumer\Analysis\WorkloadAnalyzer.cs:line 419
at WorkloadTools.Consumer.Analysis.WorkloadAnalyzer.Stop() in D:\Github\WorkloadTools-master\WorkloadTools\Consumer\Analysis\WorkloadAnalyzer.cs:line 375
at WorkloadTools.Consumer.Analysis.AnalysisConsumer.Dispose(Boolean disposing) in D:\Github\WorkloadTools-master\WorkloadTools\Consumer\Analysis\AnalysisConsumer.cs:line 71
at WorkloadTools.WorkloadController.Dispose() in D:\Github\WorkloadTools-master\WorkloadTools\WorkloadController.cs:line 110
at SqlWorkload.Program.Run(Options options) in D:\Github\WorkloadTools-master\SqlWorkload\Program.cs:line 116
at SqlWorkload.Program.Main(String[] args) in D:\Github\WorkloadTools-master\SqlWorkload\Program.cs:line 47
2021-06-17 08:36:35.1143 - Info - WorkloadTools.Consumer.Analysis.WorkloadAnalyzer : 0 rows aggregated
2021-06-17 08:36:35.3236 - Info - WorkloadTools.Consumer.Analysis.WorkloadAnalyzer : 0 rows written