Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. (Microsoft SQL Server)

I am getting the error message, "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. (Microsoft SQL Server)". I am attaching the stored procedure. Can anyone see where the syntax may
be causing this.
USE [ReportData]
GO
/****** Object: StoredProcedure [PDI].[usp_MJTestTop10_Select] Script Date: 04/23/2015 10:35:43 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
--USE [ReportData]
--GO
--/****** Object: StoredProcedure [PDI].[usp_MJTestTop10_Select] Script Date: 04/23/2015 08:22:26 ******/
--SET ANSI_NULLS ON
--GO
--SET QUOTED_IDENTIFIER ON
--GO
ALTER PROCEDURE [PDI].[usp_MJTestTop10_Select]
@StartDate DATE,
@EndDate DATE,
@Location VARCHAR
AS
DECLARE @CalendarKey TABLE (
Calendar_Key int,
Organization_Key int,
Day_Date DATETIME
BEGIN
INSERT INTO @CalendarKey
SELECT C.calendar_key,
O.Organization_Key,
C.Day_Date AS DATETIME
FROM pdi.PDI_Warehouse_952_01.dbo.calendar C,
pdi.PDI_Warehouse_952_01.dbo.Organization O
where @EndDate is not null
and C.Day_Date BETWEEN @StartDate and @EndDate
or @EndDate is null
and C.Day_Date = @StartDate
END
SELECT CAST(C.Day_Date as DATE) as [Memo Date],
--C.calendar_key,
ISNULL(CAST(MBH.Transaction_Number as VARCHAR), 'Unknown') as [Memo Number],
O.Site_id,
O.Site_desc,
--p.Product_Key,
p.UPC as [UPC],
(CAST(P.Department_ID as VARCHAR) + ' ' + CAST(P.Category_ID as VARCHAR) + ' ' + CAST(P.Sub_Category_Id as VARCHAR)) as [D C S],
ISNULL(CAST(IPF.Vendor_Key as VARCHAR), 'Unknown') as [Vendor Code],
--ISNULL(CAST(V.Vendor_Desc as VARCHAR), 'Unknown') as [Vendor Desc],
ISNULL(P.Item_Desc, 'Unknown') as [Description],
ISNULL(P.Size_Desc, 'Unknown') as [Size],
ISNULL(RTrim(Cash.Cashier_Name), 'Unknown') as [Associate],
ISNULL(CONVERT(INT, IIF.Beg_Inv_Qty, 0), '0') as [Old Qty],
ISNULL(CONVERT(INT, IIF.End_Inv_Qty,0), '0') as [Adj Qty],
ISNULL(CONVERT(INT, IIF.End_Inv_Qty - IIF.Beg_Inv_Qty, 0), '0') as [Dif Qty]
FROM pdi.PDI_Warehouse_952_01.dbo.Item_Sales_Fact ISF
INNER JOIN pdi.PDI_Warehouse_952_01.dbo.Product P ON ISF.Product_Key = P.Product_Key
LEFT JOIN pdi.PDI_Warehouse_952_01.dbo.Organization O ON ISF.Organization_key = O.organization_key
LEFT JOIN pdi.PDI_Warehouse_952_01.dbo.Item_Purchases_Fact IPF ON ISF.Product_key = IPF.Product_Key
AND ISF.Organization_key = IPF.Organization_key
AND ISF.Calendar_key = IPF.Calendar_key
LEFT JOIN pdi.PDI_Warehouse_952_01.dbo.Item_Inventory_Fact IIF ON ISF.Product_Key = IIF.Product_Key
AND IIF.Product_Key = P.Product_Key
AND ISF.Organization_key = IIF.Organization_Key
AND ISF.Calendar_key = IIF.Calendar_Key
LEFT JOIN pdi.PDI_Warehouse_952_01.dbo.Calendar C ON ISF.calendar_key = C.calendar_key
LEFT JOIN pdi.PDI_Warehouse_952_01.dbo.Cashier Cash ON ISF.Organization_Key = Cash.Organization_Key
LEFT JOIN pdi.PDI_Warehouse_952_01.dbo.Cashier_Metric_Hourly_Dept_Snapshot CMH on Cash.Organization_Key = CMH.Organization_Key
AND Cash.Cashier_Key = CMH.Cashier_Key
AND ISF.Calendar_Key = CMH.Calendar_Key
LEFT JOIN pdi.PDI_Warehouse_952_01.dbo.MarketBasket_Header MBH ON ISF.Calendar_Key = MBH.Calendar_Key
AND ISF.Organization_Key = MBH.Organization_Key
AND Cash.Cashier_Key = MBH.Cashier_Key
LEFT JOIN pdi.PDI_Warehouse_952_01.dbo.Vendor V ON IPF.Vendor_Key = V.Vendor_key
AND IPF.Calendar_Key = C.Calendar_Key
LEFT JOIN @CalendarKey CK ON ISF.Calendar_Key = ck.Calendar_Key
AND ISF.Organization_Key = CK.Organization_Key
WHERE C.calendar_key = CK.Calendar_Key
ORDER BY
O.Location_ID,
C.Day_Date,
IPF.Vendor_Key,
P.UPC,
P.Size_Desc

Some additional comments. 
@Location VARCHAR
Look closely at this.  How many characters can @Location contain?  You did not specify, so perhaps you think some appropriately large default value is used.  Guess again. You did a similar thing with cast (multiple times) - which is handled
differently.  Don't be lazy.
WHERE C.calendar_key = CK.Calendar_Key
Go review the join to the CK table.  It is an outer join.  Yet you have included criteria in the where clause that requires a match in the unpreserved (@CalendarKey aka CK) table.  This effectively transforms that join from outer to inner.
Was that intentional? Probably, but then you don't need to use an outer join
FROM pdi.PDI_Warehouse_952_01.dbo.calendar C,
pdi.PDI_Warehouse_952_01.dbo.Organization O
Evolve.  We do not join in the where clause any longer.  You should be joining using join operators.  And perhaps more importantly, why do you need to dump a resultset into a table variable at all?  Note that your join is a cross join
since there is no relationship between calendar and Organization - intentional? Given the rest of the logic, it seems that you don't really need to do this.
ISNULL(CONVERT(INT, IIF.End_Inv_Qty,0), '0') as [Adj Qty],
Go review the documentation for convert.  You supply a style, but does it do anything?  We don't know what datatype End_Inv_Qty is, but I assume it is numeric (and not float).  So what do you intend?  And you convert it to integer but
use a character '0' in the isnull function.  Your lack of consistency can lead to issues that are difficult to find and resolve.
CAST(C.Day_Date as DATE)
Why are you doing this? You defined the column in your table variable as datetime.  You cast the value you use to populate this column to datetime.  I'm guessing that you only really care about the date portion.  The name you used for the
column implies this.  So why bother with datetime in the first place?
And one last suggestion. If you disallow the use of NULL for the @EndDate argument (simply supply the same value for both date arguments) you can simplify the logic that populates your table variable (or its replacement) and greatly eliminate the confusion
and chance for errors that nullability requires.

Similar Messages

  • SCOM 2012 R2 installing on SQL 2012 SP1 - Error Code: 0x80131904, Exception.Message: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

    Hi,
    I am getting an issue during a SCOM 2012 R2 installation while creating the SCOM DataWarehouse database. Setup seems to timeout during creating the datawarehouse database. I can see all database files created in windows explorer on the SQL server before
    setup rolls the SCOM install back.
    Has anyone seen this issue before or know how to help resolve it?
    Appreciate your help, below is the SCOM installation log:
    Thanks
    Marc
    [13:27:27]: Always: :Creating Database: OperationsManagerDW
    [13:35:28]: Warn: :Warning:Retry on SQL error -2: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    [13:43:28]: Warn: :Warning:Retry on SQL error -2: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    [13:51:29]: Warn: :Warning:Retry on SQL error -2: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    [13:59:30]: Warn: :Warning:Retry on SQL error -2: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    [14:07:30]: Warn: :Warning:Retry on SQL error -2: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    [14:15:31]: Warn: :Warning:Retry on SQL error -2: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    [14:23:31]: Warn: :Warning:Retry on SQL error -2: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    [14:31:32]: Warn: :Warning:Retry on SQL error -2: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    [14:39:32]: Warn: :Warning:Retry on SQL error -2: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    [14:47:33]: Warn: :Warning:Retry on SQL error -2: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    [14:55:33]: Error: :DB operations failed with SQL error -2: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    : Threw Exception.Type: System.Data.SqlClient.SqlException, Exception Error Code: 0x80131904, Exception.Message: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    [14:55:33]: Error: :StackTrace:   at System.Data.SqlClient.SqlConnection.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.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.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.EnterpriseManagement.OperationsManager.Setup.Common.SqlRetryHandler.ExecuteNonQuery(SqlCommand sqlCommand, Int32& result)
       at Microsoft.EnterpriseManagement.OperationsManager.Setup.Common.SqlRetryHandler.Execute[T](SqlCommand sqlCommand, SqlRetryPolicy retryPolicy, GenericExecute`1 genericExecute)
    [14:55:33]: Error: :Inner Exception.Type: System.ComponentModel.Win32Exception, Exception Error Code: 0x80131904, Exception.Message: The wait operation timed out
    [14:55:33]: Error: :InnerException.StackTrace:
    [14:55:33]: Error: :Error:Failed to execute sql command. Setup has reached maximum retry limit.
    [14:55:33]: Warn: :Sql error: 11. Error: -2. Error Message: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    [14:55:33]: Error: :Exception running sql string
    DECLARE @sql NVARCHAR(MAX);
    SET @sql = 'CREATE DATABASE ' + QUOTENAME(@DatabaseName) + '
        ON PRIMARY(NAME=MOM_DATA,FILENAME=''' + REPLACE(@Filename, '''', '''''') + ''',SIZE=' + CAST(@Size AS VARCHAR) + 'MB,MAXSIZE=UNLIMITED,FILEGROWTH=' + CAST(@FileGrowth AS VARCHAR) + 'MB)
        LOG ON(NAME=MOM_LOG, FILENAME=''' + REPLACE(@LogFilename, '''', '''''') + ''',SIZE=' + CAST(@LogSize AS VARCHAR) + 'MB,MAXSIZE=UNLIMITED,FILEGROWTH=' + CAST(@LogFileGrowth AS VARCHAR) + 'MB)';
    EXEC(@sql);: Threw Exception.Type: System.Data.SqlClient.SqlException, Exception Error Code: 0x80131904, Exception.Message: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    [14:55:33]: Error: :StackTrace:   at System.Data.SqlClient.SqlConnection.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.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.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.EnterpriseManagement.OperationsManager.Setup.Common.SqlRetryHandler.ExecuteNonQuery(SqlCommand sqlCommand, Int32& result)
       at Microsoft.EnterpriseManagement.OperationsManager.Setup.Common.SqlRetryHandler.Execute[T](SqlCommand sqlCommand, SqlRetryPolicy retryPolicy, GenericExecute`1 genericExecute)
       at Microsoft.EnterpriseManagement.OperationsManager.Setup.DBConfigurationHelper.DBConfiguration.RunSqlCommandsList(IEnumerable`1 sqlCommands)
    [14:55:33]: Error: :Inner Exception.Type: System.ComponentModel.Win32Exception, Exception Error Code: 0x80131904, Exception.Message: The wait operation timed out
    [14:55:33]: Error: :InnerException.StackTrace:
    [14:55:33]: Always: :Failed to create and configure the DB with exception.: Threw Exception.Type: System.Data.SqlClient.SqlException, Exception Error Code: 0x80131904, Exception.Message: Timeout expired.  The timeout period elapsed prior to completion
    of the operation or the server is not responding.
    [14:55:33]: Always: :StackTrace:   at System.Data.SqlClient.SqlConnection.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.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.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.EnterpriseManagement.OperationsManager.Setup.Common.SqlRetryHandler.ExecuteNonQuery(SqlCommand sqlCommand, Int32& result)
       at Microsoft.EnterpriseManagement.OperationsManager.Setup.Common.SqlRetryHandler.Execute[T](SqlCommand sqlCommand, SqlRetryPolicy retryPolicy, GenericExecute`1 genericExecute)
       at Microsoft.EnterpriseManagement.OperationsManager.Setup.DBConfigurationHelper.DBConfiguration.RunSqlCommandsList(IEnumerable`1 sqlCommands)
       at Microsoft.EnterpriseManagement.OperationsManager.Setup.DWConfigurationHelper.DWConfigurationProcessor.RunAdminScripts(String sqlServerInstance, Nullable`1 port, String databaseName, Int64 dbSize, Int64 logSize, String dbPath, String logPath)
       at Microsoft.EnterpriseManagement.OperationsManager.Setup.DWConfigurationHelper.DWConfigurationProcessor.ConfigureDataWarehouseDatabase(String sqlServerInstance, Nullable`1 port, String databaseName, Int64 dbSize, Int64 logSize, String dbPath,
    String logPath)
    [14:55:33]: Always: :Inner Exception.Type: System.ComponentModel.Win32Exception, Exception Error Code: 0x80131904, Exception.Message: The wait operation timed out
    [14:55:33]: Always: :InnerException.StackTrace:
    [14:55:33]: Error: :CreateDataWarehouse failed: Threw Exception.Type: System.Data.SqlClient.SqlException, Exception Error Code: 0x80131904, Exception.Message: Timeout expired.  The timeout period elapsed prior to completion of the operation or
    the server is not responding.
    [14:55:33]: Error: :StackTrace:   at System.Data.SqlClient.SqlConnection.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.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.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.EnterpriseManagement.OperationsManager.Setup.Common.SqlRetryHandler.ExecuteNonQuery(SqlCommand sqlCommand, Int32& result)
       at Microsoft.EnterpriseManagement.OperationsManager.Setup.Common.SqlRetryHandler.Execute[T](SqlCommand sqlCommand, SqlRetryPolicy retryPolicy, GenericExecute`1 genericExecute)
       at Microsoft.EnterpriseManagement.OperationsManager.Setup.DBConfigurationHelper.DBConfiguration.RunSqlCommandsList(IEnumerable`1 sqlCommands)
       at Microsoft.EnterpriseManagement.OperationsManager.Setup.DWConfigurationHelper.DWConfigurationProcessor.RunAdminScripts(String sqlServerInstance, Nullable`1 port, String databaseName, Int64 dbSize, Int64 logSize, String dbPath, String logPath)
       at Microsoft.EnterpriseManagement.OperationsManager.Setup.DWConfigurationHelper.DWConfigurationProcessor.ConfigureDataWarehouseDatabase(String sqlServerInstance, Nullable`1 port, String databaseName, Int64 dbSize, Int64 logSize, String dbPath,
    String logPath)
       at Microsoft.SystemCenter.Essentials.SetupFramework.InstallItemsDelegates.OMDataWarehouseProcessor.CreateDataWarehouse()
    [14:55:33]: Error: :Inner Exception.Type: System.ComponentModel.Win32Exception, Exception Error Code: 0x80131904, Exception.Message: The wait operation timed out
    [14:55:33]: Error: :InnerException.StackTrace:
    [14:55:33]: Error: :FATAL ACTION: CreateDataWarehouse
    [14:55:33]: Error: :FATAL ACTION: DWInstallActionsPostProcessor
    [14:55:33]: Error: :ProcessInstalls: Running the PostProcessDelegate returned false.
    [14:55:33]: Always: :SetErrorType: Setting VitalFailure. currentInstallItem: Data Warehouse Configuration
    [14:55:33]: Error: :ProcessInstalls: Running the PostProcessDelegate for OMDATAWAREHOUSE failed.... This is a fatal item.  Setting rollback.
    marc nalder

    Hi,
    Based on the log, I recommend you use the following way to test SQL connectivity.
    You can use a UDL file to test various connectivity scenarios, create a simple text file, rename the extension from TXT to UDL, fill out the necessary information on the connection tab then test the connection, and troubleshoot as necessary
    if it fails to connect.
    For more information, please review the link below:
    The easy way to test SQL connectivity
    http://blogs.technet.com/b/michaelgriswold/archive/2014/01/06/the-easy-way-to-test-sql-connectivity.aspx
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. This failure occured while attempting to connect to the Principle server.

    We are using SQL Server 2012.
    Every now and then, when we execute the below stored procedure INSERT_INTO_MYTBL, we got the below error, and it returned @ID = 0.
    "Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. 
    This failure occured while attempting to connect to the Principle server."
    What causes this error, and how can we fix it ?
    Thank you.
    create procedure INSERT_INTO_MYTBL
    @ID int output,
    @Order varchar(50) = NULL,
    @ACCOUNT varchar(20) = NULL
    AS
    DECLARE @Success int, @TryNr int, @ErrMsg varchar(500), @ErrNumber int, @expected_id int;
    SET @Success = 0;
    SET @TryNr = 1;
    SET @ErrMsg = ''
    WHILE @Success = 0 AND @TryNr <= 3 and @ErrMsg = ''
    BEGIN;
    BEGIN TRY;
    BEGIN TRANSACTION;
    retry:
    BEGIN TRY;
    SELECT @expected_id = ident_current('myTbl') + 1
    SELECT @order = @account + '-' + CAST(@expected_id AS varchar(50))
    insert into myTbl
    ([Order],ACCOUNT)
    values
    (@Order,@ACCOUNT)
    END TRY
    BEGIN CATCH;
    SELECT @ErrNumber = ERROR_NUMBER()
    IF @ErrNumber = 2627
    BEGIN;
    GOTO retry
    END;
    ELSE
    BEGIN;
    SET @ErrMsg = '1.' + ERROR_MESSAGE() + ' ' + @order
    RAISERROR (@ErrMsg, 16, 1);
    END;
    END CATCH
    select @ID = SCOPE_IDENTITY()
    IF @id <> @expected_id
    BEGIN
    UPDATE myTbl
    SET [Order] = @ACCOUNT + '-' + CAST(@ID AS varchar(50))
    WHERE ID = @ID
    END
    SET @Success = 1
    COMMIT TRANSACTION;
    END TRY
    BEGIN CATCH;
    ROLLBACK TRANSACTION;
    SELECT @ErrNumber = ERROR_NUMBER()
    IF @ErrNumber = 1205
    BEGIN;
    SET @TryNr = @TryNr + 1;
    IF @TryNr > 3
    RAISERROR ('Giving up after 3 consecutive deadlocks for %s', 16, 1,@ACCOUNT);
    END;
    ELSE
    BEGIN;
    SET @ErrMsg = '2.' + ERROR_MESSAGE() + ' ' + @order
    RAISERROR (@ErrMsg, 16, 1);
    END;
    END CATCH;
    END;

    When the problem occurs, the stored procedure returns @ID = 0, which I think means the query
    When the problem occurs, the procedure does not return anything. SQL Server was told to stop executing. Furthermore, unless you issue the command SET XACT_ABORT ON, SQL Server will not roll back any open transaction. Which is one more reason you should not
    permit command timeouts.
    As for why this procedure sometimes take a long time, I would primarily suspect locking. When this occurs (but before the timeout elapses!), you could use my beta_lockinfo to see if there is any blocking going on. You find it here:
    http://www.sommarskog.se/sqlutil/beta_lockinfo.html
    Erland Sommarskog, SQL Server MVP, [email protected]

  • SSRS Error: The timeout period elapsed prior to completion of the operation or the server is not responding

    Hi, I am using SQL Server 2008 R2 Stored Procedure as my dataset and running yearly sales report in SSRS 2008 R2. The weird thing is in SSMS the stored procedure does not take more than 10 seconds to retrieve data and the report also works
    fine in BIDS, but from ReportServer if I were to pick an year from 1990 - 2014 they all work fine anything prior to 1990 either shows up fine or throws the below error.
    SSRS Error:
    An error has occurred during report processing. (rsProcessingAborted)
    Query execution failed for dataset 'QueryDS'. (rsErrorExecutingCommand)
    Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated.
    I checked ReportServerTemDb tables and no table seems to be really large to cause a problem. This report "KeepTogether" property is TRUE.
    Thanks in advance.............
    Ione

    Was able to fix this with the help of
    msdn documentation. The query dataset was set to 5 and this was somebody else's report I was fixing and I usually have my report template set to 0 so it took me a while to get there.
    Ione

  • The timeout period elapsed prior to completion of the operation or the server is not responding

    the timeout period elapsed prior to completion of the operation or the server is not responding.
    The error shows while executing a (select query) telerik report in MVC.

    Hello,
    Did you set the CommandTimeOut property of the SQL Command when you call the connection string to SQL Server?
    If your select query is complex or the data is larger, please try to specify connectiontimeout property to maximum integer value.
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Timeout expired. the timeout period elasped prior to completion of the operation or the server is not responding

    HI All --- i am facing " Timeout expired. the timeout period elapsed prior to completion of the operation or the server is not responding " facing this issue every second day in our database.. for the rectification we just restart
    the DB instance and its start working fine.....  although database is in working condition and other databases in same instances are working fine, please suggest me any remedy to get rid from this issue.

    Imran,
    Check this:
    http://sqlserverplanet.com/troubleshooting/fix-timeout-expired-the-timeout-period-elapsed-prior-to-completion-of-the-operation-or-the-server-is-not-responding
    (similar thread) 
    http://social.msdn.microsoft.com/Forums/silverlight/en-US/685816f3-8d06-4411-8d00-d34c48c2938d/timeout-expired-the-timeout-period-elapsed-prior-to-completion-of-the-operation-or-the-server-is?forum=silverlightgamedev
    http://blogs.msdn.com/b/spike/archive/2008/07/31/timeout-expired-the-timeout-period-elapsed-prior-to-completion-of-the-operation-or-the-server-is-not-responding.aspx
    Thanks,
    Jay
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

  • SharePoint - Error_1_Error occurred in deployment step 'Add Solution': Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was rea

    Hi,
    I am Shanmugavel, SharePoint developer, 
    I am facing the below SharePoint 2013 deployment issue while deploying using VS2012.
    If i will deploy the same wsp or existing wsp
    (last build) using direct powershell deployment, the solution adding properly, but the same timeout exception coming while activation the features.  Please find the below error.
    I tried the below activists:
    1. Restarted my dev server, DB server. 
    2. tried the same solution id different server
    3. tried existing wsp file (last build version)
    4. Deactivated all the features, including project Active deployment configuration.... but still i am facing the same issue.
    I hope this is not coding level issue, because still my code is not start running, before that some problem coming.
    Please help me any one.....  Last two days i am struck because of this...

    What you need to understand is the installation of a WSP does not do much. It just makes sure that you relevant solution files are deployed to the SharePoint farm.
    Next comes the point when you activate the features. It is when the code which you have written to "Activate" certain features for your custom solution.
    Regarding the error you are getting, it typically means that you have more connections (default is I guess 100) open for a SQL database then you are allowed to.
    If you have a custom database and you are opening a connection, make sure you close it as well.
    Look at the similar discussion here:
    The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool
    size was reached[^]
    I would suggest further to look at the
    ULS logs[^] to get better insight.
    Manas Bhardwaj's Stream : www.manasbhardwaj.net

  • Cloud Database issue:-Timeoutexpired. The Timeout perion elapsed prior to completion of the operation or the server is not responding

    I am facing following issue in cloud database
    Issue:  Altering any stored procedure in cloud database, Application throwing time out issue.
    If same stored procedure running in backend(SQL),it’s executing without delay i.e. executing in 3 sec, not sure what is happening.
    This is not happening on regular basis, After altering procedure if I wait for 15 to 20 minutes(not running any queries) then it will automatically get resolved.
    Please let me know if any fix is available for the above issue.

    Hello,
    Try to enable TCP/IP and Named Pipes using the following article. Restart SQL Server service when done.
    http://technet.microsoft.com/en-us/library/ms191294.aspx
    Enable and start SQL Server Browser service.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • What is causing this "The timeout period elapsed during the post-login phase."?

    This is happening on a shared environment running DataCenter.  We are doing a bulk merge of about 100 plus records.  It is failing in different spots but always the same error.  Sql has no error logs, and we are not seeing locks. 
    We need some hints as to what this error message really means.  
    System.Data.SqlClient.SqlException: Connection Timeout Expired.  The timeout period elapsed during the post-login phase. 
    The connection could have timed out while waiting for server to complete the login process and respond; Or it could have timed
    out while attempting to create multiple active connections.  The duration spent while attempting to connect
    to this server was - [Pre-Login] initialization=1; handshake=1; [Login] initialization=0; authentication=0;
    [Post-Login] complete=14000;  ---> System.ComponentModel.Win32Exception: The wait operation timed out

    Well, at first hand, it looks like a "time-out", obviously.
    I would check the system's resources, if it's extremely busy at that time at first. Especially CPU.. and general Login statistics
    Andreas Wolter | Microsoft Certified Master SQL Server
    Blog: www.insidesql.org/blogs/andreaswolter
    Web: www.andreas-wolter.com

  • This item could not be crawled because the repository did not respond within the specified timeout period. Try to crawl the repository at a later time, or increase the timeout value on the Proxy and Timeout page in search administration. You might also wa

    HI,
    I got the error message in the crawl log as below after performing the Full Crawl
    This item could not be crawled because the repository did not respond within the specified timeout period. Try to crawl the repository at a later time, or increase
    the timeout value on the Proxy and Timeout page in search administration. You might also want to crawl this repository during off-peak usage times.
    To overcome the above error,many forums have suggested me to increase the time out which is under Farm level settings.But if time out gets increased,performance impacts as well.
    So please suggest me to overcome this error without increasing the timeout.Thanks in advance
    Regards,
    Sudheer
    Thanks & Regards, Sudheer

    Hi,
    I understand that you get the error message when performing a full crawl. I have seen similar cases caused by IE proxy settings. You can try to edit the Internet Options>Connections>LAN settings. Uncheck ‘Automatically detect settings’.
    For more information, please refer to this site:
    Search error: crawler could not connect to the repository:
    http://social.technet.microsoft.com/forums/en-US/sharepointadminprevious/thread/c230ab36-8d0b-4c25-bf86-33136d17642b/
    Thanks,
    Entan Ming
    Entan Ming
    TechNet Community Support

  • Net connection trouble: "No Ethernet cable connected or the device is not responding"

    Hello
    I have been plagued by a dropping Net connection for a couple of months, and as it has been getting worse lately I have tried to sort out the problem.
    I have simplyfied my connection between the computers and the VSDL fiber modem by bypassing my AirPort Express and Ethernet hub and connecting the three computers directly to the built in ports on the modem.
    Since I did that a new error message has started appearing on my Mac Mini, saying that I have no Ethernet cable connected to the modem, or the device is not responding. At the moment I have two of the machines connected, and the Mac Book Air seems to work without problems. There are lights on the Ethernet ports on the modem, and they are lighting up for the iBook even when the Mac Mini connection drops. When the Mac Mini connection drops the lights go off on its Ethernet port on the modem.
    This seems to point to some sort of trouble with the Mac Mini. Is there a way to monitor what's going on? Can I use Terminal, for instace? It can't be the settings, and it cant' be the cable, so it must be related to the hardware I suppose. I am using DHCP to connect to the modem.
    The connection drops arbitrarily, sometimes for long periods of time, and then comes back up again by itself.
    Any ideas for trouble shooting etc?
    Best
    Hans Karlsson

    BDAqua
    Thanks again. Unfortunately, the problems are back again. Had a stable connection and connected the AirPort again. Everything was working fine. Then all of a sudden the connection dropped again today.h
    Connected a LAN cable directly to my MacBook Air and got the connection to work immediately.
    Took that cable and connected to my MacMini, again, connection came back immediately.
    The AirPort (in Brigde Mode) is also connected, but gives me a blinking orange light, and the same "no cable or (modem) is not responding" message again.
    I guess this must rule out hardware problems in the computers.
    Ligth for the LAN cable port on the modem connected to AirPort is dead. Moved the cable to another port, light still dead.
    Shut down AirPort Express, still same orange blinking light when I switched it on.
    I now suspect there is something going on with the AirPort Express. Just bought it, and I had the same problem with it's predecessor, but...
    Is there any way to trouble shoot the AirPort Express?
    I can connect to it Wirelessly, But AirPort Utility says it has been removed from the Network. In the Network Preferences it says it has a self-assigned IP. For Network Settings I get green lights for everything except Network Settings, which gives me a yellow light. It also says the Internet connetcion is working correctly.
    Indeed, when I made the direct Ethernet connection inactive I still get a working connection over WiFi, in spite of the blinking orange light on the AirPort and a yellow light for Network settings in Prefereces....
    In the console things look normal:
    8/7/12 10:04:27.269 PM Apple80211 framework[231]: 
    com.apple.message.domain: com.apple.wifi.timeout.scan
    com.apple.message.signature: Success
    com.apple.message.result: pass
    com.apple.message.value: 3149.000000
    com.apple.message.summarize: YES
    Still confused

  • DPM failed to communicate with the protection agent on DPM 2010 SERVER because the agent is not responding. (ID 43 Details: Internal error code: 0x8099090E)

    Hi everyone,
    Backup jobs for protected members are intermittently failing with the following error on the DPM server:
    DPM failed to communicate with the protection agent on <DPM 2010 SERVER> because the agent is not responding. (ID 43 Details: Internal error code: 0x8099090E)
    Why does the DPM server failing to see it's own DPM agent cause the backup job for another server to fail? One day a backup will work fine, the next it may fail; and the next back to normal again...
    The following error is recorded in the Service Control Manager event log on the DPM server just prior to the above error:
    A timeout was reached (30000 milliseconds) while waiting for the DPMRA service to connect.
    Thank you.
    With regards,
    Rob

    Hello,
    I have read these entire postings and see that my problems match most of the above problems. 
    I believe we have tried all of the ideas in this blog and lots of other ideas from other forums and internet searches.
    We have about 80 small databases protected and set at 15 minute incremental and most will work but some fail.  When they fail the most common, but not only error, is something like "DPM
    failed to communicate with the protection agent on <DPM 2010 SERVER> because the agent is not responding. (ID 43 Details: Internal error code: 0x8099090E)". The alert is inactivated in the DPM Console, and the backups resume as normal."
    Since later jobs are successful I thought all was well.  All was well until I went to restore from incremental backups.  We worked for two days (day and night work) to restore
    from a corrupted virtual disk on our SQL Server 2008 R2.  I suspect DPM had something to do with the corrupted virtual disk.  All I know is that we never had this problem until installing DPM.  Here is what we encountered when we went to restore
    from the protection points: 
    *  Restore jobs take a minimum of 15 minutes for jobs that are 45 MB or 2 GB. 
    *  If you pick a backup from the list of recovery points that is not valid the job runs for 15 minutes and then "Failed". 
    *  You cannot rerun the job because SQL Server 2008 has the table being recovered as <tablename> (recovering) and a retry will not work.  Of course time is wasted while waiting
    to see if it worked.
    * Eventually you realize that even after dropping the table in the (recovering) mode in SQL that the restore point must be bad or possibly one of this failed recovery points.
    * So begins the quest to start restoring recovery points one by one and 15 minutes by 15 minutes until you find one that actually restores to a SQL Instance.
    *  If you have 80 of these to do and you average trying three recovery points and each takes 15 minutes, not to mention the time to drop the table in SQL, well that time adds up to 3,600
    minutes of trial and error.  60 hours of trial and error, wow not much of a savings using DPM over a SQL backup plan.
    * And then you have to explain to your customers that their databases were restored but you do not know at what point the DB was restored. 
    All in all it seems like DPM concept is great but like many backups the backup plan looks good on paper but actually restoring a backup is quite a different matter.
    I don't know if anyone has ever solved the problems presented in this forum but if they have then I wish they would post and if no one has solved the problem then shame on DPM.
    Good luck everyone, but I for one have spent about two months on trying to protect and restore consistently.  I have never had one day of consistent and reliable restore points.  I
    am going back to sql management plans for my backups.  I have never, in 10 years had a sql generated backup fail me.  Never.
    gbl

  • PCI DIO 32HS (6533) Suddenly giving "The device is not responding to the first IRQ level" error, and no longer functioning.

    Greetings NI folks,
      I'm an oceanographer, and have an sidescan sonar data aquasition computer running Windows XP SP2, and NiDAQ 7.0 (Legacy). For several years, this machine has worked flawlessly, but today, I booted it up to test the system for an upcoming job, and I got some strange errors in our sonar program. I tranced the problem to our NI-6533 PCI-DIO-32HS card. I launched NI Automation Explorer to test that the card was responsive, and when I click the "test panel", I get an error: "The device is not responding to the first IRQ level." Continue (yes/no). If I click yes, I can test the digital i/o's, but nothing happens, and all the tests fail (nonresponsive). I tried moving the card to another PCI slot, tried forcing it to have a specific IRQ that was unused by anything else, and finally tried moving it to another computer that had never been used with the DIO card. I'm still getting the error, and the card is nonresponsive. I'm at the limit of my abilities, and would like to know if there's anything else I can do, or should we send the card back to NI for repair/diagnosis.
    Thanks.

    Duplicate Post
    Best Regards
    Hani R.
    Applications Engineer
    National Instruments

  • Hi, I got the problem with Firefox 27.0.1. I can not run Selenium on Firefox after login a website for automation testing. The browser is not responding.

    Hi, I got the problem with Firefox 27.0.1. I can not run Selenium on Firefox after login a website for automation testing. The browser is not responding. However when I close Nunit, the page is back to be normal. The title is returned to the name of website without "not responding". I sure this problem did not happen on Firefox version 26. I just got this problem when firefox upgrading automatically to version 27. Please help me fix this problem because it is very important for my work. If you need more information pls send your concerns via my email address.
    Thanks so much

    Hi, the work around suggested above should put you in working mode in the meantime. However to help investigate the issue it is possible to analyze what is not loading or taking a long time by analyzing the network traffic or http headers of the Nunit web page.
    *[https://addons.mozilla.org/en-us/firefox/addon/live-http-headers/]
    *Web developer Tools > Web console
    If you post the results with out the user data, we are happy to help.

  • I just upgraded my iMac to Lion, and a few seconds ago, I upgraded the iWork package and now I'm having some problems with the new version of Pages (4.1) When I try to change something in a document, a message says "the program is not responding"

    I just upgraded my iMac to Lion, and a few seconds ago, I upgraded the iWork package and now I'm having some problems with the new version of Pages (4.1) When I try to change something in a document, a message says "the program is not responding", so I have to force it to close. By the way, the SAVE botton stays the same even I change erverything in my document. Please, a have a work to finish, **** me. What I can do abou it?

    I just upgraded my iMac to Lion, and a few seconds ago, I upgraded the iWork package and now I'm having some problems with the new version of Pages (4.1) When I try to change something in a document, a message says "the program is not responding", so I have to force it to close. By the way, the SAVE botton stays the same even I change erverything in my document. Please, a have a work to finish, **** me. What I can do abou it?

Maybe you are looking for

  • Count Invoices without Invoice Drill-Down

    I have a requirement to count the number of invoices by  posting period and vendor, for invoices that are less than a certain amount (say $500). I intend to get this data from the standard AP line item cube. Seems like it should be simple. I can do t

  • Renting from my itunes account on someone else's Apple TV???????

    Hi. I'm visiting my parents from overseas. They have a new Apple TV. If I want to rent a tv show on their apple tv, but pay for it with my itunes account, is that possible?? or is there some sort of maximum number of accounts you can use on one Apple

  • Do I use Oracle SOA Suite or OSB or both ?

    Hi, I've done some research on the web but still it seems slightly ambiguous to me. If a company has requirements for moderate levels of business services (<100) what is the best Oracle service bus choice?. It feels like OSB and SOA Suite overlap a l

  • Duplicate Tracks - Time Machine?

    I keep getting duplicate track listings and even though I delete them they seem to be continuing to appear. It's not consistent though - some tracks have MANY dupes (7 or more sometimes!), some none, and others just a few. Is it possible that Time Ma

  • Stabilizing a video

    Many years ago I used Premiere Pro 1.5 very successfully. However, it doesn't work with the newer formats, or at least not with .mov that I now have. One very useful feature was SteadyMove under the Video Effects, worked wonders with wobbly hand-held