Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. joacker

    How to check why a query is sometimes slow

    Thx for your inputs. The RDMBS is sql server 2008. the query is part of a stored procedure that uses dynamic sql to build up the query. It also uses temp-tables which lead to an error when i wanted to take a look at the execution plan. It's just a bit strange because "normally" the query is...
  2. joacker

    How to check why a query is sometimes slow

    Hello, i wrote a client/server application. Atm i am in the test phase, so i am the only user of the system. The problem is that one of my queries is sometimes really slow, or maybe it doesn't return (i inserted a timeout so i cann't say). Now i want to analyze why that happens. So what can...
  3. joacker

    Too many indexes for this table?

    Hello, i have a table with 25 fields that holds 8 million rows. For this table i use 13 indexes. Why? I set an index for every field that's used often for join or where operations. But i read that using too many indexes is not recommendet. So i want to ask you experts: Can i use the indexes i...
  4. joacker

    Calculations with time and then cast to decimal

    Thank you very much guys. I am always impressed by the great support here.
  5. joacker

    Calculations with time and then cast to decimal

    Hello, i have the following statement: SELECT AVG(ROUND(Datediff(ss,start,end)/3600),2)) i want to have the following output: 1,27 hours 2,19 hours 1,03 hours 0,28 hours 5,93 hours As start and end variables are time datatypes i have to cast it to a decimal to get the desired output, don't i...
  6. joacker

    General SQL Questions (Group by, Select Case)

    @RiverGuy: As i am grouping by ID i have to choose an aggregate function for all the rows in the select-statement. Therefore i choose min(x) but the most values are the same for the grouped ids. (this means name = name for the grouped ids so i can take min() or max()). So i have 2-3 "real"...
  7. joacker

    General SQL Questions (Group by, Select Case)

    Thank you guys. 2 helpful answers after 30 min - your support is awesome :)
  8. joacker

    General SQL Questions (Group by, Select Case)

    Hello guys, i have 3 questions concerning sql-select statements. 1) Suppose i have a group by select statement, then i need for every column that is not used in group by an aggregate function: select id min(date) min(name) ... FROM table GROUP BY id Is there any way to avoid all this...
  9. joacker

    Does this work with a SELECT-CASE Statement?

    Thx gmmastros. This was a very helpful answer :)
  10. joacker

    Generating a report - some questions

    Thx Madawc. So can my application start cr10 and transfer the data sets automatically to it so that cr10 can display it. This is meant when i wrote "diagrams of dataset" - The value of the datasets are displayed by cr10 (in this case as chart). This shows how it works: (Just the Application...
  11. joacker

    Does this work with a SELECT-CASE Statement?

    I just had another idea: SELECT CASE WHEN nr = 1 THEN nr WHEN nr = 5 THEN nr ELSE (SELECT nr FROM table WHERE table.id = this.id + 1) END Would that be better than a self join?
  12. joacker

    Does this work with a SELECT-CASE Statement?

    Thank you guys. So imo the question is: use self-join or prepare the talbe with cursor for the select queries to avoid self-joins.
  13. joacker

    Does this work with a SELECT-CASE Statement?

    Hello, today i have the following question: I need a SELECT statement that can also return the value of row n+1, which means: SELECT CASE nr = 1 THEN nr CASE nr = 5 THEN nr ELSE nextRow.nr I guess this is not makeable with a select statement but seems to be a common problem (IF x THEN...
  14. joacker

    Accumulation of row values in a specific column

    Hi, i have a table A: ID | VALUE 1 | 2 2 | 4 4 | 5 ... Now i want to create a select statement that adds the value of row n to row n+1 and that produce the following output: ID | VALUE 1 | 2 2 | 6 (= 2 + 4) 3 | 11 (= 5 + 6) ... I am sure there is an easy way to handle this. Thx for any help.
  15. joacker

    OLTP or OLAP

    thx Paul :) so i will try it with a relational star schema first and if that doesn't work properly (response time) i will switch to OLAP.
  16. joacker

    OLTP or OLAP

    Answer to Question 1: The data volume will not grow but it will change. Which means for a new month an old month has to go (For example: Data of Nov 2008 comes - Data of Nov 2005 goes). Otherwise i think the data would become too large for a fast queries. Answer to Question 2: Just a few users...
  17. joacker

    OLTP or OLAP

    Hello Paul, yes you are correct. It is a part of a click stream analysis. Fortunatly i just have to focus on the things i wrote in the first post.
  18. joacker

    OLTP or OLAP

    As Paul helped me a lot to understand OLAP i think i finally got it now (with much reading too). But i am at a deciding point where i have to know: is olap actually the right system to use here? There is the following situation: I have a table (~400.000 rows) (no data mart or data warehouse)...
  19. joacker

    Can OLAP provide this?

    Paul, let me say a big thx for your help here. You answered some questions i couldn't find in the books and helped me a LOT with your professional answers. Also i have to apologize. I realized today that you answered my questions in a quoted text (post 2). I am used to the style that quoted...

Part and Inventory Search

Back
Top