Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6107897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:14:19+00:00 2026-05-23T14:14:19+00:00

I am getting the following error ONLY for queries run on the ReportingPeriod table

  • 0

I am getting the following error ONLY for queries run on the ReportingPeriod table (see below). This happens even when I comment-out the related LEFT JOIN on another table. There aren’t more than 200 records in the table. Additionally, it doesn’t matter if I run the query outright or run it using the stored procedure. Lastly, other tables & procedures run fine.

Any idea what may cause this?

VERSION
Sql-Server 2005

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

RAW QUERY:

DECLARE @ProjectsKey INT
SET @ProjectsKey = 1234
-----------------------------
    SELECT 
        ReportingPeriodKey
        ,ReportingPeriod.ProjectsKey
        --,Phase.PhaseKey AS PhaseKey
        --,Phase.Name AS PhaseName
        ,[Type]
        ,ReportingPeriodStart
        ,ReportingPeriodEnd
    FROM   
        ReportingPeriod
--  LEFT JOIN
--  (
--      SELECT
--          PhaseKey
--          ,ProjectsKey
--          ,Name
--      FROM dbo.Phase
--  ) AS Phase ON Phase.PhaseKey = dbo.ReportingPeriod.PhaseKey
    WHERE
        ((@ProjectsKey IS NOT NULL AND ReportingPeriod.ProjectsKey = @ProjectsKey) OR @ProjectsKey IS NULL)
    ORDER BY
        ReportingPeriodStart

TABLE DEFINITION:

SET ANSI_NULLS ON GO SET
QUOTED_IDENTIFIER ON 
GO 
CREATE TABLE [dbo].[ReportingPeriod](
    [ReportingPeriodKey] [int] IDENTITY(1,1) NOT NULL,  
    [ProjectsKey] [int] NOT NULL,   
    [PhaseKey] [int] NOT NULL, [Type] [nvarchar](250) NOT NULL,     
    [ReportingPeriodStart] [datetime] NOT NULL CONSTRAINT [DF_ReportPeriod_Start]  DEFAULT (getdate()),     
    [ReportingPeriodEnd] [datetime] NOT NULL CONSTRAINT [DF_ReportPeriod_End]  DEFAULT(getdate()),  
    [CreatedBy] [nvarchar](100) NOT NULL,
    [CreatedDate] [datetime] NOT NULL CONSTRAINT [DF_ReportingPeriod_CreatedDate] DEFAULT (getdate()),  
    [ModifiedBy] [nvarchar](100) NULL,  
    [ModifiedDate] [datetime] NULL,  

    CONSTRAINT [PK_ReportPeriod] PRIMARY KEY CLUSTERED  ( [ReportingPeriodKey] ASC )WITH (PAD_INDEX  = OFF,
    STATISTICS_NORECOMPUTE  = OFF,
    IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, 
    ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY] ) ON [PRIMARY]

GO 
ALTER TABLE [dbo].[ReportingPeriod] WITH CHECK 
ADD  CONSTRAINT [FK_ReportingPeriod_attrReportingPeriodType]
FOREIGN KEY([Type]) REFERENCES [dbo].[attrReportingPeriodType] ([FullName]) 

GO 
ALTER TABLE [dbo].[ReportingPeriod]  
CHECK CONSTRAINT [FK_ReportingPeriod_attrReportingPeriodType]

GO 
ALTER TABLE [dbo].[ReportingPeriod] WITH CHECK 
ADD  CONSTRAINT [FK_ReportingPeriod_Phase] 
FOREIGN KEY([PhaseKey]) 
REFERENCES [dbo].[Phase] ([PhaseKey]) 

GO 
ALTER TABLE [dbo].[ReportingPeriod] 
CHECK CONSTRAINT [FK_ReportingPeriod_Phase]

GO 
ALTER TABLE [dbo].[ReportingPeriod] WITH CHECK 
ADD  CONSTRAINT [FK_ReportingPeriod_Projects] 
FOREIGN KEY([ProjectsKey]) 
REFERENCES [dbo].[Projects] ([ProjectsKey]) 

GO
ALTER TABLE [dbo].[ReportingPeriod]
CHECK CONSTRAINT
[FK_ReportingPeriod_Projects]

SYSTEM STATS
There are 2 sets for object_id #875866187

reserved_page_count = 17
used_page_count = 11
row_count = 306

reserved_page_count = 2
used_page_count = 2
row_count = 306

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:14:20+00:00Added an answer on May 23, 2026 at 2:14 pm

    Have you tried checking for open transactions that may be locking the table?

    dbcc opentran
    
    exec sp_who 69
    -- Where the id is the SPID from DBCC OPENTRAN
    
    exec sp_lock 69
    -- Where the id is the SPID from DBCC OPENTRAN
    
    select * from sys.objects where object_id = 2089058478
    -- Where the id is the ObjID from sp_lock
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting this following error even though i am the only person working
I'm running Valgrind and I'm getting the following error (this is not the only
I am getting the following error message when compiling or attempting to run my
I'm getting the following error, only on the simulator and not on the iPad
I am getting the following error when I am using the code below. 02-24
In production, I'm occasionally getting the following error: Errno::ETIMEDOUT: Connection timed out - connect(2)
I am getting the following error 'Event handlers can only be bound to HttpApplication
I'm getting the following error: undefined method `id' for #<Array:0x00000101ff0b70> On this line: <%=
I am getting the following error when using the code below the error. can
Am getting following error message on calling WCF service: The formatter threw an exception

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.