Multiple Queries on one table....

Hi  - I am trying to query the same table multiple times and can't figure out how any help would be GREATLY appreciated!!  For example - I have a PRINRPT.CALL_DATE Field and in my SQL Command Statement I have asked it to only bring over PRINRPT.CALL_DATE  > 10/31/08...I then count those on my report BUT I would also like to query that same table again with PRINRPT.CALL_DATE = Today - 90 Days and then again PRINRPT.CALL_DATE from 10/31/07 to 10/31/08....I can not figure out how to do this in CR.  I tried a formula based on the PRINRPT.CALL_DATE  field - but it only returns TRUE or FALSE..I would like actual dates so I can count them in the report to get a total by principal by customer (see below).
Here is my SQL Query - let me know if it is possible please!!!  Thanks in advance for all of your help!!
Misty
SELECT ACCT_CLASS.NAME
      , ACCT_CLASS.PRIN_NAME
      , PRINRPRT.PRIN_NAME, PRINRPRT.CALL_DATE, PRINRPRT.AUTHOR
      , CUSTOMER.SALES_Name
      , CUSTOMER.SALES_NO
      , CUSTOMER.NAME
      , CUSTOMER.Customer_Class
      , ACCT_CLASS.CLASSIFICATION
      , PROJECTS.PRIN_NAME
      , PROJECTS.EST_PROF
      , SALES.PRIN_NAME
      , SALES.NOV_2008_GP, SALES.DEC_2008_GP, SALES.JAN_2009_GP,
        SALES.FEB_2009_GP, SALES.MAR_2009_GP, SALES.APR_2009_GP,
        SALES.MAY_2009_GP, SALES.JUN_2009_GP, SALES.JUL_2009_GP,
        SALES.AUG_2009_GP, SALES.SEP_2009_GP, SALES.OCT_2009_GP,
        SALES.NOV_2007_GP, SALES.DEC_2007_GP, SALES.JAN_2008_GP,
        SALES.FEB_2008_GP,    SALES.MAR_2008_GP, SALES.APR_2008_GP,
        SALES.MAY_2008_GP, SALES.JUN_2008_GP, SALES.JUL_2008_GP,
        SALES.AUG_2008_GP, SALES.SEP_2008_GP, SALES.OCT_2008_GP
FROM AveWorking.dbo.ACCT_CLASS
      JOIN AveWorking.dbo.CUSTOMER ON ACCT_CLASS.CUSTOMER_ID = CUSTOMER.CUSTOMER_ID      
LEFT JOIN AveWorking.dbo.PRINRPRT ON  ACCT_CLASS.PRIN_NAME = PRINRPRT.PRIN_NAME
        AND ACCT_CLASS.CUSTOMER_ID = PRINRPRT.CUSTOMER_ID
        AND ACCT_CLASS.NAME = PRINRPRT.NAME
        AND PRINRPRT.CALL_DATE > 10/31/2008           
LEFT  JOIN AveWorking.dbo.PROJECTS ON  CUSTOMER.CUSTOMER_ID =  PROJECTS.CUSTOMER_ID
        AND PROJECTS.NAME = PRINRPRT.NAME
        AND PROJECTS.PRIN_NAME = PRINRPRT.PRIN_NAME
LEFT JOIN AveWorking.dbo.SALES ON   PRINRPRT.PRIN_NAME = SALES.PRIN_NAME
       AND SALES.CUSTOMER_ID  = PRINRPRT.CUSTOMER_ID
ORDER BY CUSTOMER.SALES_Name, ACCT_CLASS.PRIN_NAME,PRINRPRT.PRIN_NAME,PROJECTS.PRIN_NAME

Thanks so much Carl - that was it...I think I have been staring at this for far too many hours now and can't see what is right in front of me!!
I am still having more issues with it - I hate this report!!!!  I am getting duplicate dates & sales populating now.  So for example I want:
Principal Name             Name          sales 09       Sales 08   Dates 3Mo        Dates 09         Date 08
So, I am getting Sales 09 & Sales 08 and Dates in 09 coming up multiple times per customer where there really is only one showing in the database for each day.  I think it has something to do with the sales connection (the last Left Join on my report).  I have ran it soooo many times with groups, without groups, inside out and upside down etc....but if I need an accurate count of the calls made in each column I can't have it duplicating dates...can you tell from my query as to why it might do this??? 
My ultimate goal is to have one line of data per data field above, then repeat for a new customer.
Any more ideas????
Principal Name             Name          sales 09       Sales 08   Dates 3Mo        Dates 09         Date 08
XXXX                          XXXXX         Total $          Total $         #                        #                    #
Thanks again so much, any help you can give is greatly appreciated!!
Misty
Current Query:
select  ACCT_CLASS.NAME
      , ACCT_CLASS.PRIN_NAME
      , PRINRPRT.PRIN_NAME, PRINRPRT.AUTHOR
      , CUSTOMER.SALES_Name
      , CUSTOMER.SALES_NO
      , CUSTOMER.NAME
      , CUSTOMER.Customer_Class
      , ACCT_CLASS.CLASSIFICATION
      , PROJECTS.PRIN_NAME
      , PROJECTS.EST_PROF
      , SALES.PRIN_NAME
      , SALES.NOV_2008_GP, SALES.DEC_2008_GP, SALES.JAN_2009_GP,
         SALES.FEB_2009_GP, SALES.MAR_2009_GP, SALES.APR_2009_GP,
        SALES.MAY_2009_GP, SALES.JUN_2009_GP, SALES.JUL_2009_GP,
        SALES.AUG_2009_GP, SALES.SEP_2009_GP, SALES.OCT_2009_GP,
        SALES.NOV_2007_GP, SALES.DEC_2007_GP, SALES.JAN_2008_GP,
        SALES.FEB_2008_GP, SALES.MAR_2008_GP, SALES.APR_2008_GP,
        SALES.MAY_2008_GP, SALES.JUN_2008_GP, SALES.JUL_2008_GP,
        SALES.AUG_2008_GP, SALES.SEP_2008_GP, SALES.OCT_2008_GP,
        PRINRPRT.CALL_DATE,
  case when PRINRPRT.CALL_DATE BETWEEN '11/01/2008' AND '10/31/2009' then PRINRPRT.CALL_DATE ELSE NULL end as "Call_Dates09",
  case when PRINRPRT.CALL_DATE > getdate() - 90 then PRINRPRT.CALL_DATE ELSE NULL end as "3MOCall_Dates09",
  case when PRINRPRT.CALL_DATE  BETWEEN '11/01/2007' AND '10/31/2008' THEN PRINRPRT.CALL_DATE ELSE NULL END   "CALL_DATES08"
FROM AveWorking.dbo.ACCT_CLASS
      JOIN AveWorking.dbo.CUSTOMER ON ACCT_CLASS.CUSTOMER_ID = CUSTOMER.CUSTOMER_ID      
LEFT JOIN AveWorking.dbo.PRINRPRT ON  ACCT_CLASS.PRIN_NAME = PRINRPRT.PRIN_NAME
        AND ACCT_CLASS.CUSTOMER_ID = PRINRPRT.CUSTOMER_ID
        AND ACCT_CLASS.NAME = PRINRPRT.NAME                 
LEFT  JOIN AveWorking.dbo.PROJECTS ON  CUSTOMER.CUSTOMER_ID =  PROJECTS.CUSTOMER_ID
        AND PROJECTS.NAME = PRINRPRT.NAME
        AND PROJECTS.PRIN_NAME = PRINRPRT.PRIN_NAME
LEFT JOIN AveWorking.dbo.SALES ON  CUSTOMER.CUSTOMER_ID = SALES.CUSTOMER_ID
        AND ACCT_CLASS.PRIN_NAME = SALES.PRIN_NAME
        AND ACCT_CLASS.NAME = SALES.NAME       
ORDER BY CUSTOMER.SALES_Name, ACCT_CLASS.PRIN_NAME,PRINRPRT.PRIN_NAME,PROJECTS.PRIN_NAME
Edited by: Misty Whitney on Jul 28, 2009 3:07 PM

Similar Messages

  • Using DATA_CELL and multiple queries into one table

    Hi WAD experts,
    I have been trying to work out how to combine multiple hidden query result sets in their own tables in the template, into one table displayed as if the data originated from one query.
    I have been looking at using the DATA_CELL method of "modify table" class.
    Has anyone had to do this before - and if so do you have any clues as to how best to do this ?
    Thanks
    Chris

    Here is what I want:
    Say I have a query that tells me about how many items were sold at a hardware store for each week. Then the output would look something like this:
    Week,Item,Num_Sold
    13,Hammer,15
    13,Nail,594
    13,Screw,398
    14,Hammer,16
    14,Nail,382
    14,Screw,331
    But I want my output to look like this:
    <space>,13,14 <-- these would be the week numbers
    Hammer,15,16
    Nail,594,382
    Screw,398,331
    I asked this same question in a SQL-only forum and one person responded that they did not know how to do that. But I figure that this is done often enough that there must be some Open Source program that can transform the output data into a table. As you can see, it's not a pure transform. It's more like I take one column, make that the x-axis, another column, make that the y-axis, and "plot" the data based on the two columns. It's kinda like taking 1D data and making it 2D. There's no existing open source program which does this? I figure that I could just give the program my SQL queries, specify some rule such as "Make the first column of the resultset the row, make the second column the column and create a table with the 3rd row, using the first two rows to map the 3rd row into the table". Note that I think this only works with 3 columns.
    Anyway, if there is no simple program that already does this, I can make a program to do what I just described. I just asked the question here because I figure that there are a lot of people knowledgeable about SQL and Java on this forum and that someone would know of a tool which already does what I want if one exists.

  • How to execute multiple queries in one stored procedure.

    Hi,
    I am Kumar,
    How to execute multiple queries in one stored procedure.
    here is the my requirements,
    1. get the max value from one table and sum of the that value.
    2. insert the values and also sum of the max value.
    using stored procedure
    I am using SQL server 2000 database.
    Please help me.
    Advance thanks
    by,
    Kumar

    This is not a java question and it is not even a problem: your only problem is
    1) lack of knowledge
    2) lack of interest to find a manual
    But you are going to have to change both by actually reading a book or a manual that explains the stored procedure language of SQL Server. It is the same as Sybase I think, so you could also look for a manual for that DBMS.

  • Display Data from multiple models in one table

    Hi Experts,
    Is it possible to display data from multiple models in one table smltnsly.
    I have created a table dynamically.Now I would like to display data from multiple models... If this possible,can anyone give me a lead as to how to do it..
    Regards
    SU

    Hi
    Your Model Nodes be
    Model1
    ---Output_Model1
    Attrib1
    Attrib2
    Model2
    ---Output_model2
    Attrib1
    Attrib2
    and the value node is
    ValueNode
    ---Attrib1
    ---Attrib2
    Now the coding.
    int size;
    IPrivate<ViewName>.IOutput_mode1Node  node1 = wdContext.nodeOuptut_Model1();
    IPrivate<ViewName>.IValueNodeElement elem;
    size = node1.size();
    for(int i=0; i<size; i++)
       elem = wdContext.createValueNodeElement();
       elem.setAttrib1( node1.getOutput_Model1ElementAt(i).getAttrib1() );
       elem.setAttrib2( node1.getOutput_Model1ElementAt(i).getAttrib2();
       wdContext.nodeValueNode().addElement( elem );
    similar code for Model Node 2
    Regards
    Abhimanyu L

  • How to get the data from multiple nodes to one table

    Hi All,
    How to get the data from multiple nodes to one table.examples nodes are like  A B C D E relation also maintained
    Regards,
    Indra

    HI Indra,
    From Node A, get the values of the attributes as
    lo_NodeA->GET_STATIC_ATTRIBUTES(  IMPORTING STATIC_ATTRIBUTES = ls_attributesA  ).
    Similarily get all the node values from B, C, D and E.
    Finally append all your ls records to the table.
    Hope you are clear.
    BR,
    RAM.

  • Can we use multiple queries on one template

    Can we use multiple queries on one template

    Hi,
    if you're using data templates for your data set, you
    can put multiple queries in the XML data template.
    The queries may then be linked (or not) by the "link
    name" tag ...
    Grtz.Following you answer here...do you know eventually how/if possible to preview a report (with XMLP Desktop) that is using data templates for the data set?
    Thanks,
    Liviu

  • Moving multiple queries from one category to another in QM

    Hi All,
    Is there is any way of moving multiple queries from one category to another in the query manager?
    Or is the only way of doing it by saving each one individually into a different category.
    Any ideas ?
    Regards,
    Rakesh N

    Hi Rakesh,
    The query manager has limited function compare with normal file management applications. Under current design, you have to do this one by one. You just need to make sure move the smaller amount of queries to large category. Category name can be changed easily.
    Thanks,
    Gordon

  • BEX Workbook - consolidating common data from multiple queries into a table

    Hello BW Gurus,
    We have couple of queries. One getting data for Material and its components and the other query getting sales volume for  material along with many other data.
    In the other tab, I would like to display only the Material and its sales volume as another table.
    Is there a setting in the BEX to group only these fields and populate values in a different tab?
    regards
    S R

    Can you pls elaborate?
    Do you want multiple reports on single excel sheet? also do you want to have any relation between them like only those materials that appeared in first report?

  • How to embed multiple queries in one web template

    Hi,
    I've a requirement wherein I need to embed two queries in one web template. The first query displays order quantity from a particular customer and the second query displays other information for that customer. Most of my web templates i've contains only one query which i've created using 0ADHOC template saving this as diff template and modifying it. But this is the first time I have got this type of requirement wherein the user drills down on a particular customer for order quantity and then goes for other information from other query.
    Does anyone out there has any idea or suggestion as to how to do this ? One more thing I need to pass the values from one query to another which is akin to RRI concept while staying in the same web template.
    Your suggestions/advices are highly appreciated.
    Thanks in Advance,
    Rash.

    Hi Rash,
    You can do this by including 2 table web items in your template and assiging the 2 different queries as different dataproviders to each. You can try to create a drop down box to filter the customer and in its properties set DataProvider1 and DataProvider2 as the affected data targets.
    Hope this helps...

  • Results of multiple queries in one report

    Hi
    I would like to create one report with multiple rows and each row should display result of a different query.
    I guess I can use multiple report on one region or multiple regions in one place.
    (1)However is there a more elegant way of creating a single report look and feel...eg like it would happen in excel.
    (2)Is it better to have one page with multiple regions or multiple reports in one region.
    Thanks
    Faizi

    I'm not sure if it suite your needs,
    but maybe you can use UNION in your queries to get them together in one report ??
    Second option:
    Denes did great work and he created some how-to about putting mulitple reports in one region:
    http://deneskubicek.blogspot.com/2007/06/multiple-reports-in-one-region.html
    Hope this helps.
    Tomasz K.

  • SQL Developer cannot execute multiple queries in one connection

    Hi,
    Using : SQL Developer 1.2.29.98, Oracle Database 9i on Windows XP.
    Currently I have TOAD and PL/SQL Developer to handle things related to Oracle Database.
    I found this SQL Developer tools as an interesting tool which might replace PL/SQL Developer (I assume).
    I opened two SQL Worksheets and tried to execute 2 queries (time consuming one) simultanously, suddenly it freezes (the window become grayed). Just like TOAD, we cannot smoothly execute multiple queries on single connection on SQL Developer
    I can monitor the query process using TOAD (Session Browser) and found both queries are running while SQL Developer window become grayed and seems not functioning. After the queries have been finished, I mean both of them, the SQL Developer window become normal and "alive" again showing the expected results.
    Well, however PL/SQL Developer could handle this. Executing multiple queries in single application is just its unbeatable features.
    We can view the query result once its finished instead of until the others being processed, by just only switch the SQL Windows.
    Is it true that SQL Developer doesn't support executing multiple queries?
    Or is it a feature which we should request?
    Or we have to activate this feature by doing some changes on configuration / preferences?
    (Do we need to open two SQL Developer instances? what a memory consuming solution).
    Regards,
    Buntoro

    SQLDeveloper connections are single threaded and also rather single minded (in that you can't do much else while a long query is running.)
    There is an existing feature request http://apex.oracle.com/pls/otn/f?p=42626:39:3685254426061901::NO::P39_ID:4202 for which you can vote.
    The workaround is to have multiple connections. Not brilliant but it works.

  • Combine Multiple Worksheets into one table

    Hello Everyone!
    I have 2 Excel worksheets within the same workbook. Both have identical tables with almost the same fields except for 2 or 3 different columns in one of the sheets. Currently I have a macro assigned to a button on one of the sheets and I have to click on
    it to combine the 2 sheets. I also have a Pivot Table on one of the sheets which pulls data from the table on that sheet and displays it on the existing sheet.
    I wish to :
    1. Combine (merge) these two sheets into one table on a new worksheet when Excel file is opened rather than clicking on the button.
    2. Once the Excel file is opened, i would like to have the Pivot Table to pull data off the combined sheet and display it next to the combined table. Essentially I would like the Pivot Table to be refreshed with the new data from the Combined table rather
    than from one table.
    Is this possible ?
    I use the following code to combine the two sheets, but I don't know how to proceed further. Can someone please help me with the rest ?? Thanks in advance.
    Here's the code:
    Option Explicit
    Sub Combine()
    Dim J As Integer
    On Error Resume Next
    Sheets(1).Select
    Worksheets.Add
    Sheets(1).Name = "Combined Results"
    Sheets(2).Activate
    Range("A1").EntireRow.Select
    Selection.Copy Destination:=Sheets(1).Range("A1")
    For J = 2 To Sheets.Count
    Sheets(J).Activate
    Range("A1").Select
    Selection.CurrentRegion.Select
    Selection.Offset(1, 0).Resize(Selection.Rows.Count - 1).Select
    Selection.Copy Destination:=Sheets(1).Range("A65536").End(xlUp)(2)
    Next
    End Sub
    The problem with being punctual is, there's nobody there to appreciate it !!!

    Hi,
    This is the forum to discuss questions and feedback for Microsoft Excel, the issue is more related to Excel DEV. I'll move your question to the MSDN forum for Excel
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Multiple Queries in one Report

    What is the best way to show the data of 2 queries in one report?

    Hi Frank,
    It purely depends on the reporting needs I would say. You could simply add the two queries, create joins in Crystal Reports and drag the required fields in the details section.
    The joins in this case, however, would be executed by Crystal Reports, unlike when the report is created off a Relational database.
    -Abhilash

  • Multiple sequences on one table?

    I have a simple table with 3 columns: ID, DML_ID and VALUE. The table was designed to be a metadata table with values for certain DML_IDs. The table has been maintained by IT. However, now the users wants to have control over some of the values. Let's call it User_Maintained values. IT does DML on this table and migrate the change to acceptance and production. At the same time users do DML in production. This causes ID conflict between dev, acc and prod.
    My solution is to use 2 sequences, one for IT_maintained IDs the other for User_maintained IDs. One of the sequences starts with a much bigger number like 1000000 to avoid the conflict. Create a before insert trigger on the table to pick the right sequence number depends on if the DML is IT or user maintained.
    My question here is, is it ok to use 2 sequences on one table? Is it against best practice of Oracle?
    Another idea from my co-worker is, use single sequence instead of 2. The sequence will reside in production database and all the 3 databases (dev, acc and prod) will get ID from the same sequence through dblink. Personally I don't like the idea because I don't think getting sequence from production to be used in development is the "best pratice" of Oracle. Although I don't know where I can find the document to support my opinion.
    Any idea is appreciated!!
    Sharon

    I've discussed with the DBAs and some developers, we all have concern about the idea of one sequence on production being used by all 3 databases (dev, acc and prod). Database clone is one issue. Also making one database (dev or acc) relies on another (production) is not a good approach. Each database should be as independent as possible - only create the linkage when it's necessary. In this case I don't think it's necessary.
    I will go with one sequence for user maintained values (in prod), and a manual increase number (max(id) of IT maintained value plus 1) for IT list.
    I do all these because the table was a bad design from the first begining so I can't really come up with a correct solution to work around this.
    Thanks for everybody who gave input here. Very appreciated!

  • Concurrent delete queries on one table

    Hi folks,
    I just recently started working with SQL server. I did my research and I guess that the post http://social.msdn.microsoft.com/Forums/en-US/7fe7499e-10a5-4371-84a4-aa1df8187a04/can-i-prevent-deadlock-during-concurrent-delete?forum=transactsql hits and somehow
    sovles my problem 100%.
    I am glad to have my issue resolved but I am also interested in understanding what went wrong deep inside as much as learn what I might do better. My scenario:
    4 processes updating disjunct entries at different intervals within the same table and issuing delete queries on that table. Sometimes (maybe once a day) that gives me a deadlock. colums: value, mainclass, subclass, timestamp with a clustered index at timestamp
    (My statement is of the form "delete from table where maintype=sth  and subtype=sth and timestamp=st")
    I'll append a sample deadlock graph. My main questions, which I couldn't answer so far:
    1. Is this expected behaviour or should SQL Server be able to handle such requests, or to put it right do I have to care for structures that avoid the above scenario, do I have to reconfigure or is there sth else to look at?
    2. Is this a configuration problem?
    3. I also do not understand why the report states that the processes fought for page ids when the lock escalation type was set to table.
    4. As far as I got to know until now having a clustered index on the timestamp colum is likely to boost my problem rather than solving it?
    I am really looking forward to any insights you can give.
    Bye,
    Lamu
    <deadlock>
    <victim-list>
    <victimProcess id="process56d746188" />
    </victim-list>
    <process-list>
    <process id="process56d746188" taskpriority="0" logused="0" waitresource="PAGE: 5:1:210559 " waittime="3120" ownerId="2642852343" transactionname="user_transaction" lasttranstarted="2014-09-05T11:16:12.683" XDES="0x5a36bd740" lockMode="U" schedulerid="4" kpid="3204" status="suspended" spid="72" sbid="1" ecid="4" priority="0" trancount="0" lastbatchstarted="2014-09-05T11:16:12.990" lastbatchcompleted="2014-09-05T11:16:12.683" lastattention="1900-01-01T00:00:00.683" clientapp="WIRELESS LOCALIZATION SYSTEM 1.15.0" hostname="S-ITCS-ORTUNG" hostpid="6504" isolationlevel="read committed (2)" xactid="2642852343" currentdb="5" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056">
    <executionStack>
    <frame procname="adhoc" line="1" stmtstart="94" sqlhandle="0x020000008e714d2c0ee98fc35b8a7712a719321f42c9366a0000000000000000000000000000000000000000">
    DELETE [statisticlog] WHERE [statisticid]=@1 AND [storageid]=@2 AND [timest]&lt;@3 </frame>
    <frame procname="adhoc" line="1" sqlhandle="0x02000000e1914b015d3b4d5ca54af4b548f2990acfe909ec0000000000000000000000000000000000000000">
    DELETE from statisticlog where ((statisticid='node.temperatur') and (storageid='17:85:00:00:1a:18.0')) AND timest &lt; {ts '1970-01-01 01:00:00.000' } </frame>
    </executionStack>
    <inputbuf>
    DELETE from statisticlog where ((statisticid='node.temperatur') and (storageid='17:85:00:00:1a:18.0')) AND timest &lt; {ts '1970-01-01 01:00:00.000' } </inputbuf>
    </process>
    <process id="process7edeee188" taskpriority="0" logused="0" waitresource="PAGE: 5:1:196655 " waittime="3124" ownerId="2642852343" transactionname="user_transaction" lasttranstarted="2014-09-05T11:16:12.683" XDES="0x8747f1740" lockMode="U" schedulerid="2" kpid="7108" status="suspended" spid="72" sbid="1" ecid="2" priority="0" trancount="0" lastbatchstarted="2014-09-05T11:16:12.990" lastbatchcompleted="2014-09-05T11:16:12.683" lastattention="1900-01-01T00:00:00.683" clientapp="WIRELESS LOCALIZATION SYSTEM 1.15.0" hostname="S-ITCS-ORTUNG" hostpid="6504" isolationlevel="read committed (2)" xactid="2642852343" currentdb="5" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056">
    <executionStack>
    <frame procname="adhoc" line="1" stmtstart="94" sqlhandle="0x020000008e714d2c0ee98fc35b8a7712a719321f42c9366a0000000000000000000000000000000000000000">
    DELETE [statisticlog] WHERE [statisticid]=@1 AND [storageid]=@2 AND [timest]&lt;@3 </frame>
    <frame procname="adhoc" line="1" sqlhandle="0x02000000e1914b015d3b4d5ca54af4b548f2990acfe909ec0000000000000000000000000000000000000000">
    DELETE from statisticlog where ((statisticid='node.temperatur') and (storageid='17:85:00:00:1a:18.0')) AND timest &lt; {ts '1970-01-01 01:00:00.000' } </frame>
    </executionStack>
    <inputbuf>
    DELETE from statisticlog where ((statisticid='node.temperatur') and (storageid='17:85:00:00:1a:18.0')) AND timest &lt; {ts '1970-01-01 01:00:00.000' } </inputbuf>
    </process>
    <process id="process7edeefc38" taskpriority="0" logused="0" waitresource="PAGE: 5:1:196655 " waittime="3119" ownerId="2642852529" transactionname="user_transaction" lasttranstarted="2014-09-05T11:16:12.973" XDES="0x87f3ddbb0" lockMode="U" schedulerid="2" kpid="5216" status="suspended" spid="62" sbid="1" ecid="2" priority="0" trancount="0" lastbatchstarted="2014-09-05T11:16:12.980" lastbatchcompleted="2014-09-05T11:16:12.973" lastattention="1900-01-01T00:00:00.973" clientapp="WIRELESS LOCALIZATION SYSTEM 1.15.0" hostname="S-ITCS-ORTUNG" hostpid="1308" isolationlevel="read committed (2)" xactid="2642852529" currentdb="5" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056">
    <executionStack>
    <frame procname="adhoc" line="1" stmtstart="94" sqlhandle="0x020000008e714d2c0ee98fc35b8a7712a719321f42c9366a0000000000000000000000000000000000000000">
    DELETE [statisticlog] WHERE [statisticid]=@1 AND [storageid]=@2 AND [timest]&lt;@3 </frame>
    <frame procname="adhoc" line="1" sqlhandle="0x02000000dd48f433f7e565ecccaaf5283c2e99548dd371d20000000000000000000000000000000000000000">
    DELETE from statisticlog where ((statisticid='GWConnect') and (storageid='17:85:00:00:19:c8.0')) AND timest &lt; {ts '1970-01-01 01:00:00.000' } </frame>
    </executionStack>
    <inputbuf>
    DELETE from statisticlog where ((statisticid='GWConnect') and (storageid='17:85:00:00:19:c8.0')) AND timest &lt; {ts '1970-01-01 01:00:00.000' } </inputbuf>
    </process>
    <process id="process681871868" taskpriority="0" logused="0" waitresource="PAGE: 5:1:210559 " waittime="3118" ownerId="2642852529" transactionname="user_transaction" lasttranstarted="2014-09-05T11:16:12.973" XDES="0x87bb39740" lockMode="U" schedulerid="1" kpid="8088" status="suspended" spid="62" sbid="1" ecid="3" priority="0" trancount="0" lastbatchstarted="2014-09-05T11:16:12.980" lastbatchcompleted="2014-09-05T11:16:12.973" lastattention="1900-01-01T00:00:00.973" clientapp="WIRELESS LOCALIZATION SYSTEM 1.15.0" hostname="S-ITCS-ORTUNG" hostpid="1308" isolationlevel="read committed (2)" xactid="2642852529" currentdb="5" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056">
    <executionStack>
    <frame procname="adhoc" line="1" stmtstart="94" sqlhandle="0x020000008e714d2c0ee98fc35b8a7712a719321f42c9366a0000000000000000000000000000000000000000">
    DELETE [statisticlog] WHERE [statisticid]=@1 AND [storageid]=@2 AND [timest]&lt;@3 </frame>
    <frame procname="adhoc" line="1" sqlhandle="0x02000000dd48f433f7e565ecccaaf5283c2e99548dd371d20000000000000000000000000000000000000000">
    DELETE from statisticlog where ((statisticid='GWConnect') and (storageid='17:85:00:00:19:c8.0')) AND timest &lt; {ts '1970-01-01 01:00:00.000' } </frame>
    </executionStack>
    <inputbuf>
    DELETE from statisticlog where ((statisticid='GWConnect') and (storageid='17:85:00:00:19:c8.0')) AND timest &lt; {ts '1970-01-01 01:00:00.000' } </inputbuf>
    </process>
    <process id="process6e959f0c8" taskpriority="0" logused="10000" waittime="3087" schedulerid="4" kpid="6624" status="suspended" spid="62" sbid="1" ecid="0" priority="0" trancount="2" lastbatchstarted="2014-09-05T11:16:12.980" lastbatchcompleted="2014-09-05T11:16:12.973" lastattention="1900-01-01T00:00:00.973" clientapp="WIRELESS LOCALIZATION SYSTEM 1.15.0" hostname="S-ITCS-ORTUNG" hostpid="1308" loginname="LocSystem" isolationlevel="read committed (2)" xactid="2642852529" currentdb="5" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056">
    <executionStack>
    <frame procname="adhoc" line="1" stmtstart="94" sqlhandle="0x020000008e714d2c0ee98fc35b8a7712a719321f42c9366a0000000000000000000000000000000000000000">
    DELETE [statisticlog] WHERE [statisticid]=@1 AND [storageid]=@2 AND [timest]&lt;@3 </frame>
    <frame procname="adhoc" line="1" sqlhandle="0x02000000dd48f433f7e565ecccaaf5283c2e99548dd371d20000000000000000000000000000000000000000">
    DELETE from statisticlog where ((statisticid='GWConnect') and (storageid='17:85:00:00:19:c8.0')) AND timest &lt; {ts '1970-01-01 01:00:00.000' } </frame>
    </executionStack>
    <inputbuf>
    DELETE from statisticlog where ((statisticid='GWConnect') and (storageid='17:85:00:00:19:c8.0')) AND timest &lt; {ts '1970-01-01 01:00:00.000' } </inputbuf>
    </process>
    </process-list>
    <resource-list>
    <pagelock fileid="1" pageid="210559" dbid="5" subresource="FULL" objectname="LocSystem.LocSystem.statisticlog" id="lock707200480" mode="U" associatedObjectId="72057594045464576">
    <owner-list>
    <owner id="process6e959f0c8" mode="U" />
    </owner-list>
    <waiter-list>
    <waiter id="process56d746188" mode="U" requestType="wait" />
    </waiter-list>
    </pagelock>
    <pagelock fileid="1" pageid="196655" dbid="5" subresource="FULL" objectname="LocSystem.LocSystem.statisticlog" id="lock6ddb9e400" mode="U" associatedObjectId="72057594045464576">
    <owner-list>
    <owner id="process681871868" mode="U" />
    </owner-list>
    <waiter-list>
    <waiter id="process7edeee188" mode="U" requestType="wait" />
    </waiter-list>
    </pagelock>
    <pagelock fileid="1" pageid="196655" dbid="5" subresource="FULL" objectname="LocSystem.LocSystem.statisticlog" id="lock6ddb9e400" mode="U" associatedObjectId="72057594045464576">
    <owner-list>
    <owner id="process7edeee188" mode="U" requestType="wait" />
    </owner-list>
    <waiter-list>
    <waiter id="process7edeefc38" mode="U" requestType="wait" />
    </waiter-list>
    </pagelock>
    <pagelock fileid="1" pageid="210559" dbid="5" subresource="FULL" objectname="LocSystem.LocSystem.statisticlog" id="lock707200480" mode="U" associatedObjectId="72057594045464576">
    <owner-list>
    <owner id="process56d746188" mode="U" requestType="wait" />
    </owner-list>
    <waiter-list>
    <waiter id="process681871868" mode="U" requestType="wait" />
    </waiter-list>
    </pagelock>
    <exchangeEvent id="Pipe59935a700" WaitType="e_waitPipeGetRow" nodeId="1">
    <owner-list>
    <owner id="process7edeefc38" />
    <owner id="process681871868" />
    </owner-list>
    <waiter-list>
    <waiter id="process6e959f0c8" />
    </waiter-list>
    </exchangeEvent>
    </resource-list>
    </deadlock>

    >1. Is this expected behaviour or should SQL Server be able to handle such requests, or to put it right do I have to >care for structures that avoid the above scenario, do I have to reconfigure or is there sth else to look at?
    Basically yes.  Because your queries are non-trivial the DELETE query plans for different queries may conflict.
    >2. Is this a configuration problem?
    It's influenced by your table indexing, and especially how well your DELETE statements are supported by the physical data structures in your table.  The bigger and more complicated the physical design, the more likely that concurrent DELETES will conflict.
    >3. I also do not understand why the report states that the processes fought for page ids when the lock escalation >type was set to table.
    Page locks are never the result of lock escalation.  Row locks escalate to Table locks.  Period.  When a query uses Page locks it's an optimization to avoid taking lots of row locks to begin with.  But this comes at the possible cost
    of some concurrency.  The
    ROWLOCK query hint, possibly along with the READPAST hint can force more granular locking.
    >4. As far as I got to know until now having a clustered index on the timestamp colum is likely to boost my problem >rather than solving it?
    You minimize the locking conflicts by ensuring that it's very simple to find the rows affected by your DELETE. There's not enough information here to speculate on which physical design (partition scheme, clustered index, non-clustered indexes...) is optimal
    for this.
    A threshold question is whether you really _need_ these deletes to run concurrently on the table.  If not, then you can simply serialize them (eg with TABLOCK).
    David
    David http://blogs.msdn.com/b/dbrowne/

Maybe you are looking for

  • Sample application not working

    hi, i am a newbie to javawebstart.. i have 2 questions 1) i downloaded the sample application from the net ( http://java.sun.com/developer/releases/javawebstart/) and was trying the "LibInstaller" sample.. i have been able to run step 1 (ant main : c

  • How can i stop firefox from trying to exit, when i just want to close a tab, using my custom button on my mouse?

    I use the Microsoft intellimouse explorer 3.0 since many ears. Ever since i started using firefox i set the small thumb button to the action "close" in the mouse settings. This worked fine with firefox 3.x, it closed the tab i was reading. In firefox

  • Invoice verification (MIRO) filed selection

    Hi Experts, Could please explain, where we can invoice verification MIRO field selection. I want to change invoice party field selection which in the MIRO header - Details tab from display mode to change mode. My requirement is to change invoice part

  • Finding tables used in all the procedure.

    Hi, We have around 2000 procedures in our oracle 9i database. I want to know which procedures are calling few of the tables eg: emp or dept. Is there any way I can findout or Is there any tool. Regards MMU

  • Table JAVA$CLASS$MD5$TABLE is not created by loadjava

    When loading a class using loadjava, the table JAVA$CLASS$MD5$TABLE is not created (in the schema where the class is loaded) by the loadjava tool although it should do this according to the doc. Where is this table located? The class loads successful