Advertisement

05.08.2008 at 03:49AM PDT, ID: 23385577
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

SQL 7 - Timeout expired

I hav a project it was working fine..but now when i try the search option its giving a sql time out expired error..
Start your free trial to view this solution
Question Stats
Zone: Microsoft
Question Asked By: cinibia_nidhin
Solution Provided By: angelIII
Participating Experts: 1
Solution Grade: A
Views: 0
Translate:
Loading Advertisement...
05.08.2008 at 03:53AM PDT, ID: 21523648

Rank: Savant

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.08.2008 at 04:08AM PDT, ID: 21523710

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.08.2008 at 04:12AM PDT, ID: 21523724

Rank: Savant

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.08.2008 at 05:20AM PDT, ID: 21524003

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.08.2008 at 05:34AM PDT, ID: 21524072

Rank: Savant

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.08.2008 at 05:42AM PDT, ID: 21524117

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.08.2008 at 05:56AM PDT, ID: 21524178

Rank: Savant

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.08.2008 at 06:25AM PDT, ID: 21524395

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.08.2008 at 06:41AM PDT, ID: 21524559

Rank: Savant

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.08.2008 at 06:44AM PDT, ID: 21524592

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.08.2008 at 06:45AM PDT, ID: 21524604

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.08.2008 at 07:03AM PDT, ID: 21524758

Rank: Savant

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 11:21PM PDT, ID: 21538028

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 11:48PM PDT, ID: 21538062

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.10.2008 at 01:41AM PDT, ID: 21538249

Rank: Savant

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.10.2008 at 02:16AM PDT, ID: 21538310

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.10.2008 at 02:25AM PDT, ID: 21538330

Rank: Savant

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.10.2008 at 02:38AM PDT, ID: 21538350

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.10.2008 at 02:42AM PDT, ID: 21538355

Rank: Savant

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.10.2008 at 03:04AM PDT, ID: 21538382

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.10.2008 at 03:05AM PDT, ID: 21538385

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.10.2008 at 03:10AM PDT, ID: 21538394

Rank: Savant

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.10.2008 at 03:12AM PDT, ID: 21538396

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.10.2008 at 03:18AM PDT, ID: 21538408

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.10.2008 at 03:21AM PDT, ID: 21538416

Rank: Savant

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.10.2008 at 04:17AM PDT, ID: 21538501

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.10.2008 at 04:33AM PDT, ID: 21538553

Rank: Savant

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.10.2008 at 04:45AM PDT, ID: 21538589

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.10.2008 at 04:53AM PDT, ID: 21538607

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.10.2008 at 05:08AM PDT, ID: 21538658

Rank: Savant

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.10.2008 at 09:26AM PDT, ID: 21539544

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.11.2008 at 01:33AM PDT, ID: 21541839

Rank: Savant

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
05.08.2008 at 03:53AM PDT, ID: 21523648

Rank: Savant

you will have to tune the query, ie check the execution plan of it.
probably, the query is doing a full table scan or the like.
 
05.08.2008 at 04:08AM PDT, ID: 21523710
it has to do full table scan for the search..any other suggestion?
 
05.08.2008 at 04:12AM PDT, ID: 21523724

Rank: Savant

>it has to do full table scan for the search..any other suggestion?
can you explain that, please?
 
05.08.2008 at 05:20AM PDT, ID: 21524003
it is query where it shud search the whole table to get the desired result
 
05.08.2008 at 05:34AM PDT, ID: 21524072

Rank: Savant

please be more detailed...
if you have a query that does a full table scan, the bigger the table, the more time it will take.
also, how do you run the query?
 
05.08.2008 at 05:42AM PDT, ID: 21524117
i tried to execute the query directly in SQL Server but its taking time and atlast it gives this timeout expired error..And its for some records only.. the query am using is

SELECT A.documentno, A.documentno, a.transdate
FROM tbllocalpohead A
WHERE 1 = 1 AND
        (SELECT SUM(B.Qty) - SUM(B.Received_Qty)
           AS BalanceQty
      FROM tbllocalpodetail B
      WHERE B.documentno = A.documentno) > 0 AND
    DATEPART(yyyy, transdate) >= '2005' AND status <> '1' AND
    account_code = '1042' AND a.documentno NOT IN
        (SELECT b.documentno
      FROM tbllocalpodetail b
      WHERE LEFT(b.itemcode, 1) = 'C')
ORDER BY 1
 
05.08.2008 at 05:56AM PDT, ID: 21524178

Rank: Savant

what indexes do you have on the table tbllocalpodetail ?
ie, if you don't have an index on column documentno, it will be "normal" to have bad performance.

anyhow, ensure you have that index, and then you might also change the query slightly:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
SELECT A.documentno, A.documentno, a.transdate
FROM tbllocalpohead A
WHERE 1 = 1 
  AND (SELECT SUM(B.Qty) - SUM(B.Received_Qty) AS BalanceQty
         FROM tbllocalpodetail B
        WHERE B.documentno = A.documentno) > 0 
  AND transdate >= CONVERT(datetime, '2005-01-01', 120)
  AND status <> '1' 
  AND account_code = '1042' 
  AND NOT EXISTS ( SELECT NULL
                     FROM tbllocalpodetail b
                    WHERE b.documentno = a.documentno 
                      AND b.itemcode LIKE 'C%'
                 )
ORDER BY 1
Open in New Window
 
05.08.2008 at 06:25AM PDT, ID: 21524395
THANK U SOO MUCH..actually it works ok for some records, but for some its giving the same error timeout expired after searching for a long time. is there any way to increase the query execution time??
 
05.08.2008 at 06:41AM PDT, ID: 21524559

Rank: Savant

>is there any way to increase the query execution time??
if you tell me this:
how do you run the query?
 
05.08.2008 at 06:44AM PDT, ID: 21524592
i tried to execute it from the application as well as i pasted the query in sql server directly..but both are taking some time to search and it gives the same time out error..
 
05.08.2008 at 06:45AM PDT, ID: 21524604
and also Angel u told its better to use indexes..how can i use it..am actually new to this
 
05.08.2008 at 07:03AM PDT, ID: 21524758

Rank: Savant

>and also Angel u told its better to use indexes..how can i use it..am actually new to this

please run this sql:
1:
2:
3:
4:
CREATE INDEX idx_tbllocalpodetail on tbllocalpodetail ( documentno, itemcode )
 
 
and see if the query get's faster.
Open in New Window
 
05.09.2008 at 11:21PM PDT, ID: 21538028
its fast for some records but am getting the same timeout error for a particular accountcode. There are lots of record in that database
 
05.09.2008 at 11:48PM PDT, ID: 21538062
Am using the below query; its giving result for accountcode='1427' but time out error for '1042'...I found out that there are 817 records with accountcode='1042' but only 313 records having accountcode='1427' ..is it becos of this large numb of records its giving timeout error?? if so plzz give me a solution

SELECT A.documentno, A.documentno, a.transdate
FROM tbllocalpohead A
WHERE 1 = 1 AND
        (SELECT SUM(B.Qty) - SUM(B.Received_Qty)
           AS BalanceQty
      FROM tbllocalpodetail B
      WHERE B.documentno = A.documentno) > 0 AND
    transdate >= CONVERT(datetime, '2005-01-01', 120) AND
    status <> '1' AND account_code = '1042' AND
    NOT EXISTS
        (SELECT NULL
      FROM tbllocalpodetail b
      WHERE b.documentno = a.documentno AND
           b.itemcode LIKE 'C%')
ORDER BY 1
 
05.10.2008 at 01:41AM PDT, ID: 21538249

Rank: Savant

do you have any indexes on account_code and status?
also, what are the data types of those 2 fields?
 
05.10.2008 at 02:16AM PDT, ID: 21538310
no i havent put index for status..i have put for documentno,accountcode,itemcode.. i got a temporary solution..in the connection string when i typed commandtimeout=0 it doesnt generate the timeout error. It gives the result...But it takes very very long time to generte the result.. do you have a solution for this??
 
05.10.2008 at 02:25AM PDT, ID: 21538330

Rank: Savant

please answer the questions I asked in my comment above.
 
05.10.2008 at 02:38AM PDT, ID: 21538350
Am sorry , the datatypes are

documentno & account code is nvarchar
status is int
 
05.10.2008 at 02:42AM PDT, ID: 21538355

Rank: Savant

you need to remove the quotes around the value for status.
next, create a index on the table tbllocalpohead

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
CREATE INDEX idx_tbllocalpohead ON tbllocalpohead ( account_code,  transdate , status )
 
 
 
SELECT A.documentno, A.documentno, a.transdate
FROM tbllocalpohead A
WHERE 1 = 1 
AND (SELECT SUM(B.Qty) - SUM(B.Received_Qty) AS BalanceQty
           FROM tbllocalpodetail B
        WHERE B.documentno = A.documentno) > 0 
AND transdate >= CONVERT(datetime, '2005-01-01', 120) 
AND status <> 1 
AND account_code = '1042' 
AND NOT EXISTS
        (SELECT NULL
      FROM tbllocalpodetail b
      WHERE b.documentno = a.documentno 
           AND b.itemcode LIKE 'C%')
ORDER BY 1
Open in New Window
 
05.10.2008 at 03:04AM PDT, ID: 21538382
thank u angel.. i did so..but still its taking some time to generate the result..
 
05.10.2008 at 03:05AM PDT, ID: 21538385
thank u angel.. i did so..but still its taking some time to generate the result..
 
05.10.2008 at 03:10AM PDT, ID: 21538394

Rank: Savant

could you attach the execution plan of the query?
and/or attach the database?
 
05.10.2008 at 03:12AM PDT, ID: 21538396
thank u angel.. i did so..but still its taking some time to generate the result..
 
05.10.2008 at 03:18AM PDT, ID: 21538408