Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 17th, 2008, 03:21 AM
Registered User
 
Join Date: Mar 2008
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;


 
Old March 18th, 2008, 02:22 AM
Authorized User
 
Join Date: Sep 2003
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





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.