Advertisement

03.26.2008 at 08:19AM PDT, ID: 23270725
[x]
Attachment Details

Timeout expired

Asked by lyptus in Visual Studio .NET 2005, SQL Server 2005

Tags: Microsoft, Sql Server, 2005

I am using the following query to bind a datagrid
SELECT     OutOfCell.CurrentBookingNbr, OutOfCell.FullName, OutOfCell.Location, OutOfCellRecords.OfficerNbr, OutOfCellRecords.Time
FROM         (SELECT     TOP (100) PERCENT dbo.Inmate.CurrentBookingNbr, dbo.Inmate.InmateLastName + N', ' + dbo.Inmate.InmateFirstName AS FullName,
                                              OutOfCell_1.Name AS Location, MAX(dbo.OutOfCellLog.DateTime1) AS DateTime, dbo.Cell.CellNbr, dbo.Section.SectionName,
                                              dbo.Section.SectionNbr
                       FROM          dbo.Inmate INNER JOIN
                                              dbo.OutOfCell AS OutOfCell_1 ON dbo.Inmate.OutofCellID = OutOfCell_1.OutOfCellID INNER JOIN
                                              dbo.OutOfCellLog ON dbo.Inmate.CurrentBookingNbr = dbo.OutOfCellLog.BookingNbr INNER JOIN
                                              dbo.OutOfCellDetails ON dbo.OutOfCellLog.OutOfCellLogUID = dbo.OutOfCellDetails.OutOfCellLogUID INNER JOIN
                                              dbo.Cell ON dbo.Inmate.CellID = dbo.Cell.CellID INNER JOIN
                                              dbo.Section ON dbo.Cell.SectionNbr = dbo.Section.SectionNbr
                       GROUP BY dbo.Inmate.CurrentBookingNbr, dbo.Inmate.InmateLastName + N', ' + dbo.Inmate.InmateFirstName, OutOfCell_1.Name, dbo.Cell.CellNbr,
                                              dbo.Section.SectionName, dbo.Section.SectionNbr
                       ORDER BY FullName) AS OutOfCell INNER JOIN
                          (SELECT     OutOfCellLog_1.BookingNbr, OutOfCellLog_1.OfficerNbr, CASE WHEN OutOfCellDetails_1.Name NOT LIKE '%*%' THEN CONVERT(Char(5),
                                                   DateTime1, 108) ELSE Substring(OutOfCellDetails_1.Name, 0, 3) + CONVERT(Char(5), DateTime1, 108) END AS Time,
                                                   MAX(OutOfCellLog_1.DateTime1) AS DateTime
                            FROM          dbo.OutOfCellLog AS OutOfCellLog_1 INNER JOIN
                                                   dbo.OutOfCellDetails AS OutOfCellDetails_1 ON OutOfCellLog_1.OutOfCellLogUID = OutOfCellDetails_1.OutOfCellLogUID INNER JOIN
                                                       (SELECT     TOP (100) PERCENT OutOfCellLog_1.BookingNbr, MAX(OutOfCellLog_1.DateTime1) AS DateTime
                                                         FROM          dbo.OutOfCellLog AS OutOfCellLog_1 INNER JOIN
                                                                                dbo.OutOfCellDetails AS OutOfCellDetails_1 ON
                                                                                OutOfCellLog_1.OutOfCellLogUID = OutOfCellDetails_1.OutOfCellLogUID INNER JOIN
                                                                                dbo.Inmate AS Inmate_1 ON OutOfCellLog_1.BookingNbr = Inmate_1.CurrentBookingNbr
                                                         WHERE      (OutOfCellDetails_1.TransINorOUT LIKE N'%To%') AND (OutOfCellLog_1.OfficerNbr IS NOT NULL)
                                                         GROUP BY OutOfCellLog_1.BookingNbr
                                                         HAVING      (OutOfCellLog_1.BookingNbr IS NOT NULL)
                                                         ORDER BY OutOfCellLog_1.BookingNbr DESC, DateTime DESC) AS inmates ON OutOfCellLog_1.BookingNbr = inmates.BookingNbr AND
                                                    OutOfCellLog_1.DateTime1 = inmates.DateTime
                            WHERE      (OutOfCellDetails_1.TransINorOUT LIKE N'%To%')
                            GROUP BY OutOfCellLog_1.BookingNbr, OutOfCellLog_1.OfficerNbr, CASE WHEN OutOfCellDetails_1.Name NOT LIKE '%*%' THEN CONVERT(Char(5),
                                                    DateTime1, 108) ELSE Substring(OutOfCellDetails_1.Name, 0, 3) + CONVERT(Char(5), DateTime1, 108) END
                            HAVING      (OutOfCellLog_1.BookingNbr IS NOT NULL) AND (OutOfCellLog_1.OfficerNbr IS NOT NULL)) AS OutOfCellRecords ON
                      OutOfCell.CurrentBookingNbr = OutOfCellRecords.BookingNbr AND OutOfCell.DateTime = OutOfCellRecords.DateTime
WHERE     (OutOfCell.SectionNbr LIKE '%')

However whenever I try to do that it comes up with the following error
"Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
"
Any help would be appreciated.
Thanks,
Aditya

Start Free Trial
[+][-]03.26.2008 at 08:28AM PDT, ID: 21212665

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.26.2008 at 08:30AM PDT, ID: 21212697

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.26.2008 at 08:34AM PDT, ID: 21212739

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.26.2008 at 10:02AM PDT, ID: 21213819

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Studio .NET 2005, SQL Server 2005
Tags: Microsoft, Sql Server, 2005
Sign Up Now!
Solution Provided By: bhess1
Participating Experts: 2
Solution Grade: A
 
 
[+][-]03.26.2008 at 10:23AM PDT, ID: 21214069

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.26.2008 at 10:59AM PDT, ID: 21214447

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.26.2008 at 11:05AM PDT, ID: 21214509

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.26.2008 at 04:06PM PDT, ID: 21217340

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.26.2008 at 04:41PM PDT, ID: 21217531

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628