******************** time ********************
2022-10-17 11:09:37


******************** query ********************
SELECT COALESCE((SELECT CASE COUNT(*) % 10 WHEN 0 THEN COUNT(*) / 10 ELSE COUNT(*) / 10 +1 END FROM (SELECT Id, FactorNo AS DocNo, SPRefNo AS DocRefNo, CustomerId, CustomerName, EDate, (SELECT CASE WHEN(SELECT COALESCE((SELECT COUNT(*) FROM __SPBalance__ WHERE PreSPId = (SELECT SPId FROM __Android__SPFactorRelatedSPFactor__ WHERE AppSPId = sp.Id AND FPId = 19)), 0)) = 0 AND(SELECT COALESCE((SELECT COUNT([FactorSum]) FROM dbo.__PreSPShipROSPSums__ (19, '2022-03-21 00:00:00', '2023-03-20 00:00:00') WHERE [PreNo] = (SELECT FactorNo FROM __SPFactor__ WHERE Id = (SELECT SPId FROM __Android__SPFactorRelatedSPFactor__ WHERE AppSPId = sp.Id AND FPId = 1)) AND [FactorSum] > 0), 0)) = 0 THEN 0 ELSE 1 END) AS IsConverted FROM __Android__SPFactor__ sp WHERE FPId = 19 AND UserId = 18 ) as innerTable WHERE    EDate >= (SELECT DATEADD(dd, DATEDIFF(dd, 0, '2022-03-21 00:00:00'), 0)) AND EDate < (SELECT DATEADD(day, 1,(select DATEADD(dd, DATEDIFF(dd, 0, '2023-03-20 00:00:00'), 0))))),0) AS[total_page] 


******************** message ********************
Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.


******************** InnerException ********************
System.ComponentModel.Win32Exception (258): The wait operation timed out.


******************** StackTrace ********************
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
   at Dapper.SqlMapper.ExecuteReaderWithFlagsFallback(IDbCommand cmd, Boolean wasClosed, CommandBehavior behavior) in /_/Dapper/SqlMapper.cs:line 1075
   at Dapper.SqlMapper.QueryRowImpl[T](IDbConnection cnn, Row row, CommandDefinition& command, Type effectiveType) in /_/Dapper/SqlMapper.cs:line 1187
   at Dapper.SqlMapper.QueryFirstOrDefault[T](IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Nullable`1 commandTimeout, Nullable`1 commandType) in /_/Dapper/SqlMapper.cs:line 774
   at BaseServices.SysDataAccessLayer.ExecuteQueryFirstOrDefault[T](IDbConnection& dbConnection, String query, Int32& errIndex, Object param, IDbTransaction dbTransaction)
   at BaseServices.Services.Implementation.SPFactorRepository.GetPostedSPFactorPagination(APIHeader header, PostedFilter postedFilter)


