Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 17th, 2008, 03:21 AM
Registered User
 
Join Date: Mar 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problematic Queries

well i m facing a time out prob in my databse and server

i think that there is oem prob in quaer plz check an do let me know plz
declare @id uniqueidentifier

declare @type varchar(50)

set @id = '048E29F9-29BF-4ABD-B24E-05ADE41FCFF9'

set @type = 'BM'

--CREATE PROCEDURE proInComingTransactionsCOC(@type varchar(50), @id varchar(50)) AS

--BEGIN

--if @type='MUTHOOT'

--BEGIN

            Select

                        td.Id,

                        td.PayinDateTime,

                        td.TransactionNumber,

                        td.Status,

                        td.RecommendedPayOutAgentId,

                        cd.BFName +' '+ cd.BLName as Name,

                        td.PayOutAmount as PayOutAmount,

                        ll.Name as City

            From

                        TransactionDetails td

            inner join PaymentModeList pml on td.Paymentmode=pml.Value

            inner join CustomerDetails cd on td.ID=cd.TransactionID

            inner join LocationList ll on ll.ID=td.PayoutLocationID

            Where td.RecommendedPayOutAgentId

                        In (Select Id From AgentLocationList Where AgentAccountId=@Id and Name like '%Muthoot%')

                        And td.Status = 'Processed' --And PaymentMode Not Like '%Draft%'

                        and pml.Prefix = 'COC' order by td.PayinDatetime;


Reply With Quote
  #2 (permalink)  
Old March 18th, 2008, 02:22 AM
Authorized User
 
Join Date: Sep 2003
Location: Delhi, Delhi, India.
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to prabodh_mishra
Default

Why don't you try moving your IN query to make a join.

            From TransactionDetails td
            inner join PaymentModeList pml on td.Paymentmode=pml.Value
            inner join CustomerDetails cd on td.ID=cd.TransactionID
            inner join LocationList ll on ll.ID=td.PayoutLocationID
            inner join AgentLocationList ALoc on ALoc.ID = td.RecommendedPayOutAgentId
            Where ALoc.Id=@Id and ALoc.Name like '%Muthoot%')
                        And td.Status = 'Processed'
                        and pml.Prefix = 'COC' order by td.PayinDatetime;

Cheers,
Prabodh
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problematic MDI/XNA Enslave C# 2005 0 June 28th, 2007 06:19 AM
Problematic constructions RoSi.006 XSLT 1 September 29th, 2006 06:42 AM
Combining Queries or results from 2 queries Ford SQL Server 2000 24 November 7th, 2005 08:54 PM
Update queries socoolbrewster Access 4 March 4th, 2004 06:18 PM
Queries xzvi0r Access 5 September 8th, 2003 10:03 AM



All times are GMT -4. The time now is 09:49 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.