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]

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. (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.

  • 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

  • Please help me resolve the Lync server 2013 deployment error: "An error occurred while applying SQL script for the feature BackendStore."

    I am getting an error in "Step 2 - Setup or Remove Lync Server Components" of "Install or Update Lync Server System" step.
    "An error occured while applying SQL script for the feature BackendStore. For details, see the log file...."
    Additionally, all previous steps such as: Prepare Active Directory, Prepare first Standard Edition server, Install Administrative Tools, Create and publish topology are done without any errors. The user that I used to setup the Lync server is member of:
    Administrators
    CSAdministrator
    Domain Admins
    Domain Users
    Enterprise Admins
    Group Policy Creator Owners
    RTCComponentUniversalServices
    RTCHSUniversalServices
    RTCUniversalConfigReplicator
    RTCUniversalServerAdmins
    Schema Admins
    I have tried to re-install all the things and started to setup a new one many times but the same error still occurred. Please see the log below and give me any ideas/solutions to tackle this problem.
    ****Creating DbSetupInstance for 'Microsoft.Rtc.Common.Data.BlobStore'****
    Initializing DbSetupBase
    Parsing parameters...
    Found Parameter: SqlServer Value lync.lctbu.com\rtc.
    Found Parameter: SqlFilePath Value C:\Program Files\Common Files\Microsoft Lync Server 2013\DbSetup.
    Found Parameter: Publisheracct Value LCTBU\RTCHSUniversalServices;RTC Server Local Group;RTC Local Administrators;LCTBU\RTCUniversalServerAdmins.
    Found Parameter: Replicatoracct Value LCTBU\RTCHSUniversalServices;RTC Server Local Group.
    Found Parameter: Consumeracct Value LCTBU\RTCHSUniversalServices;RTC Server Local Group;RTC Local Read-only Administrators;LCTBU\RTCUniversalReadOnlyAdmins.
    Found Parameter: DbPath Value D:\CsData\BackendStore\rtc\DbPath.
    Found Parameter: LogPath Value D:\CsData\BackendStore\rtc\LogPath.
    Found Parameter: Role Value master.
    Trying to connect to Sql Server lync.lctbu.com\rtc. using windows authentication...
    Sql version: Major: 11, Minor: 0, Build 2100.
    Sql version is acceptable.
    Validating parameters...
    DbName rtcxds validated.
    SqlFilePath C:\Program Files\Common Files\Microsoft Lync Server 2013\DbSetup validated.
    DbFileBase rtcxds validated.
    DbPath D:\CsData\BackendStore\rtc\DbPath validated.
    Effective database Path: \\lync.lctbu.com\D$\CsData\BackendStore\rtc\DbPath.
    LogPath D:\CsData\BackendStore\rtc\LogPath validated.
    Effective Log Path: \\lync.lctbu.com\D$\CsData\BackendStore\rtc\LogPath.
    Checking state for database rtcxds.
    Checking state for database rtcxds.
    State of database rtcxds is detached.
    Attaching database rtcxds from Data Path \\lync.lctbu.com\D$\CsData\BackendStore\rtc\DbPath, Log Path \\lync.lctbu.com\D$\CsData\BackendStore\rtc\LogPath.
    The operation failed because of missing file '\\lync.lctbu.com\D$\CsData\BackendStore\rtc\DbPath\rtcxds.mdf'
    Attaching database failed because one of the files not found. The database will be created.
    State of database rtcxds is DbState_DoesNotExist.
    Creating database rtcxds from scratch. Data File Path = D:\CsData\BackendStore\rtc\DbPath, Log File Path= D:\CsData\BackendStore\rtc\LogPath.
    Clean installing database rtcxds.
    Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    ****Creating DbSetupInstance for 'Microsoft.Rtc.Common.Data.RtcSharedDatabase'****
    Initializing DbSetupBase
    Parsing parameters...
    Found Parameter: SqlServer Value lync.lctbu.com\rtc.
    Found Parameter: SqlFilePath Value C:\Program Files\Common Files\Microsoft Lync Server 2013\DbSetup.
    Found Parameter: Serveracct Value LCTBU\RTCHSUniversalServices;RTC Server Local Group.
    Found Parameter: DbPath Value D:\CsData\BackendStore\rtc\DbPath.
    Found Parameter: LogPath Value D:\CsData\BackendStore\rtc\LogPath.
    Trying to connect to Sql Server lync.lctbu.com\rtc. using windows authentication...
    Sql version: Major: 11, Minor: 0, Build 2100.
    Sql version is acceptable.
    Validating parameters...
    DbName rtcshared validated.
    SqlFilePath C:\Program Files\Common Files\Microsoft Lync Server 2013\DbSetup validated.
    DbFileBase rtcshared validated.
    DbPath D:\CsData\BackendStore\rtc\DbPath validated.
    Effective database Path: \\lync.lctbu.com\D$\CsData\BackendStore\rtc\DbPath.
    LogPath D:\CsData\BackendStore\rtc\LogPath validated.
    Effective Log Path: \\lync.lctbu.com\D$\CsData\BackendStore\rtc\LogPath.
    Checking state for database rtcshared.
    Reading database version for database rtcshared.
    Database version for database rtcshared - Schema Version5, Sproc Version 0, Update Version 1.
    Thanks and Regards,
    Thanh Le

    Thanks Lạc
    Phạm 2
    I Had similar issue i end up uninstalling and reinstallting but same issue, then i change the drive but same issue. It was I/O issue. After adjusting my I/O it fix our issue and installation went on without any issue. 
    If any one using KVM here is detail article 
    We just  give this option cache=‘writeback
    using this article http://www.ducea.com/2011/07/06/howto-improve-io-performance-for-kvm-guests/ and http://itscblog.tamu.edu/improve-disk-io-performance-in-kvm/ this fix my issue thanks 

  • An error occurred while trying to connect to the provider

    Hi Experts,
    I have written a custom connector to the UWL. This is first time I am working on this concept. After writting I was deployed the PAR into the portal and configured UWL settings. But When I check the UWL it is showing "An error occurred while trying to connect to the provider" in details it is showing " Time out occured. Time taken is more than 30 seconds"
    Can you please tell me what might be the problem.
    Thanks a lot

    Hi Xinjiang,
        Thank you for your reply. I am facing an issue when I Login and open 'Work Overview' screen the warning message shows as 'An error occurred while trying to connect to the provider' when I click the Detail button I am seeing 'Actioninbox' status 'timeout' message 'Time out occurred. Time taken is more than 30 seconds'. My requirement is to stop display this warning message. I have read many thread and some of them answer, I tried the below suggested thread but still i am facing the issue.. Your help will be really appreciated...
    /thread/770521 [original link is broken]
    Best Regards,
    Jr.SRM

  • Cannot delete itunes from pc,message states. a network error occurred while attempting to read from the file C:\windows\installer\itunes.msi

    ITUNES WILL NOT DELETE FROM ADD @ REMOVE PROGRAMS,
    MESSAGE, READS  a network error occured while attempting to read from the file  C:WINDOWS\installer\iTunes.msi

    All sorted now just needed to repair itunes from control panel

  • While updating the older version iTunes to latest one it shows "a network error occurred while attempting to read from the file: C:\windows\installer\iTunes64.msi. pls help on this matter to connect my i5 to PC. Thanks in advance

    while updating the older version iTunes to latest one it shows "a network error occurred while attempting to read from the file: C:\windows\installer\iTunes64.msi. pls help on this matter to connect my i5 to PC. Thanks in advance

    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page): 
    http://majorgeeks.com/download.php?det=4459
    (2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • I am getting "a network error occurred while attempting to read from the file c:\windows\installer\itunes.msi" when I attempt to download itunes, can someone help me with this?

    I am getting "a network error occurred while attempting to read from the file c:\windows\installer\itunes.msi" when I attempt to install itunes.  Can anybody help me to resolve this issue?

    You can try disabling the computer's antivirus and firewall during the download the iTunes installation
    Also try posting in the iTunes forum since it is not an iPod touch problem.

  • Trying to update to iTunes 10.4.1 and I get a message "A network error occured while attempting to read from the file C:|Windows|Installer|iTunes.msi"  Running WIndows 7 with all updates done.  I  have never had an issue with iTunes updating before.  Anyo

    iTunes has tried to update itself and runs into an error and tells me to manually install.  When I d/l and run the iTunesSetup.exe file I always encounter the following error message...
    "A network error occured while attempting to read from the file C;|Windows|Installer|iTunes.msi" and iTunes does not update to iTunes 10.4.1.
    Anyone know what is creating this error message?  Thanks for the help...

    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page): 
    http://majorgeeks.com/download.php?det=4459
    (2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider,

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider,
    error: 40 - Could not open a connection to SQL Server)

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named
    Pipes Provider, error: 40 - Could not open a connection to SQL Server)
    Hello,
    Make sure your SQL Server service is started.
    Make sure TCP\IP and names pipes protocol is enabled
    Make sure you have made an exception in firewall for SQL Server connection
    Make sure SQL Server browser service is enabled
    Make sure you connect with correct name hostname\instance name for named instance,MSSQLSERVER for default instance and Hotname\SQLEXPRESS for express edition.
    Please make sure you use port no when connecting to SQL server listeing on different port (hostname\instance ,portno)
    http://blogs.msdn.com/sql_protocols/archive/2006/09/30/SQL-Server-2005-Remote-Connectivity-Issue-TroubleShooting.aspx
    Hope this helps
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • An error occurred while attempting to communicate with the AirPort Express

    I have an Airport Base Station (ABS) and 2 Airport Express (AES) units spread through my apartment connected in a WDS network. The ABS was using version 5.5.1 and the Express units were using 6.1.1 because I had read these versions had less problems disconnecting. But yesterday, while changing the access list in the different stations, both of my AES came back with an error that read 'An error occurred while attempting to communicate with the AirPort Express'. No resets or firmware updates would restore them to a working state from a MacBook Pro 2.4 GHz where I had the latest Airport Utility. There was always a communication error.
    I was able to update the units using an old PowerBook G4 running at 500MHz with the old Airport Setup Assistant. Both AES units were updated to version 6.3 and were put back in the WDS. Airport Setup Assistant has trouble communicating with the Airport Card in the MacBook Pro 2.4. I hope this helps others get their AES working again.
    Message was edited by: Merbil Gonzalez

    Thank you! That was helpful. I guess I'm lucky that I have an old ibook to use.
    Does Apple know about this issue???

  • WMIProviderException: An error occurred when attempting to connect to the report server remote procedure call (RPC) end point

    I am getting the following error message while trying to configure a database for a Reporting Service Server.  Both SQL Server and Reporting server are 2012 named instances.  I have 2014 instances as well on the same server.
    Exception details...
    Microsoft.ReportingServices.WmiProvider.WMIProviderException: An error occurred when attempting to connect to the report server remote procedure call (RPC) end point. Verify that the Report Server Windows service is running, and then retry the operation.
     ---> System.Runtime.InteropServices.COMException (0x800706B3): The RPC server is not listening. (Exception from HRESULT: 0x800706B3)
       --- End of inner exception stack trace ---
       at Microsoft.ReportingServices.WmiProvider.RSWmiAdmin.ThrowOnError(ManagementBaseObject mo)
       at Microsoft.ReportingServices.WmiProvider.RSWmiAdmin.GenerateDatabaseScript(String databaseName, Int32 lcid, Boolean isSharePointIntegrated, String& script)
       at ReportServicesConfigUI.WMIProvider.RSReportServerAdmin.GenerateDatabaseScript(String databaseName, Int32 lcid, Boolean isSharePointIntegrated, String& script)
    Can someone help me on this please?

    Hi Jaigi,
    According to your description, you want to change a report server database for Reporting Services. But it fails on the last step and returns a error. Right?
    In this scenario, it seems you are creating a report server database on another server via remote connection. Based on the error message, it has issues on executing the script for generating new database. Please check if you have permission to connect the
    server and create a new database. Also please check if the Reporting Services Windows services is working properly.
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • OS X Server App - An SSL error has occurred and a secure connection to the server cannot be made

    OS X Server App - An SSL error has occurred and a secure connection to the server cannot be made

    Deleting the servermgrd certificate in Keychain Access > System > Certificates worked for me as well.
    It was the only one I had to delete.

Maybe you are looking for

  • Version Problem??

    Hi, I am using Form Builder 6.0.8.11.3 . I have a problem with the Trigger Level Execution Hierarchy Property. I have when-new-item-instance trigger set at Item level and at the block level.The Item level triger has it's execution hierarchy set to af

  • My Plugs don't fit with my Bumper case

    My usb & speaker cables don't fit w/my bumbercase. It's annoying i have to remove it to play music in my car or on my speakers.

  • How to divide result in 80/20

    Hi I have bit different requirement. I have table A which has 1000 records. Now I was insert 80% of record from table A into Table B80 and remaining 20% in C20 How can I do that.

  • How to not create File without any payload?

    Hi XI Experts, I have the following integration scenario: 1.  One input file 2.  One or more output files (up to four files) 3.  At any given time, I could have one or more files (up to four files) filled with data in the payload. Question - there ar

  • Print more than what's showing in text field?

    Is there any way I can set a pdf form to print more than what is displayed in a text field? i.e., when there are more text lines than space in the text field and you need to scroll down to read it? The only way I can think is to collate responses and