Forum Replies Created

Viewing 15 posts - 151 through 165 (of 1,082 total)

  • RE: Another Pivot question

    mmm that is going to be tricky ...

    Could you not just join your other tables to the dynamic query:

    --TEST DATA

    --**************************************

    CREATE TABLE contactinfo

    (

    person_id INT,

    question VARCHAR(1000),

    answer VARCHAR(2000)

    )

    CREATE TABLE personinfo

    (

    person_id...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Another Pivot question

    Ok I hope I'm understanding what you saying but sorry if I've misunderstood:-)

    This code you will see that if you add extra rows with different questions to the table before...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Query on 16 millions rows -> 20 ms. vs Query on 4 millions rows -> 1 ms.

    could you post the actual execution plan?

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Another Pivot question

    This can be done dynamically without having to change the code.

    Could you supply some sample data and what the output should be please 🙂

    thanks

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: find missing hours between date range in sqlserver

    Welcome to SSC 🙂

    I hope find all the help you need here.

    Please could I ask that you read the link in my sig about how to make the best posts,...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Query Timeout

    I'm sorry but I have to back up Gianluca Sartori here.

    He has tried to help the OP at the beginning of the thread with some suggestions on changing the order...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Formatting Dates in SQL 2005

    Glad I could help 🙂

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Formatting Dates in SQL 2005

    DECLARE @Date DATETIME

    SET @Date = '2009-05-01 13:43:15'

    SELECT REPLACE(CONVERT(varchar(13),@Date,10),'-','')

    Check out the CONVERT function in BOL

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: MAX

    also depends if you have SET ANSI_WARNINGS ON or not

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Long execution times when including simple SQL functions into a join

    IS this query only supposed to return the correct phone numbers?

    If this is case I think I will work on a short circuit case statement in the where clause...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Long execution times when including simple SQL functions into a join

    I've tried using scalar functions that don't access data and Gail is correct that most of the time they perform poorly.

    I've tried to break this query down for the mil...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Date format dd-MMM-yyyy works only sometimes

    could you show us you SQL ?

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Attempting to either create a temporary table or index statitics.

    I'm sure about why you getting error.

    However if there is a certain query or table that you have identified as being a poor perform, throw the code at us and...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Query Timeout

    I agree, this was a very useful thread and I think alot things have been cleared up 🙂

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Query Timeout

    awesome Gail found us he he he

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life

Viewing 15 posts - 151 through 165 (of 1,082 total)