Forum Replies Created

Viewing 15 posts - 121 through 135 (of 463 total)

  • RE: link or website for Performance tuning and optimizing query

    I was going through one white paper recently and thought its good. A lengthy one but discusses lot of aspects with performance tuning.

    (May be more suited for a DBA...

    ---------------------------------------------------------------------------------

  • RE: Total Sales

    Please read this article on how to post query,

    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    Is this what you need?

    select geog.region_name, sum(sales) AS Total_sales

    from store_info inner join geog

    On geog.store_name = store_info.store_name

    Where geog.region_name = 'west'

    group by geog.region_name

    Order...

    ---------------------------------------------------------------------------------

  • RE: Elliminate Cross Join in the query

    What is the business rule to get your 'first' and 'last' row?

    AS suggested earlier, give some test data in a consumable format and what you expect and the rule for...

    ---------------------------------------------------------------------------------

  • RE: Elliminate Cross Join in the query

    Some test data and table script would help a lot.

    But is this what you want?

    Select X.id,Y.id,X.create_time Pending_time,Y.create_time unlock_time

    From ticket_history X

    JOIN ticket_history Y

    ON X.ticket_id = Y.ticket_id

    AND X.state_id = Y.state_id

    Where...

    ---------------------------------------------------------------------------------

  • RE: Triggers - Fire and Forget

    Not completely sure if I understand your requirement, but i think 'multithreading' is something you may want to look at. Create a new thread and leave it to execute. This...

    ---------------------------------------------------------------------------------

  • RE: convert the string value into varchar

    or this?

    Declare @string varchar(20)

    SET @string = '2009-Nov-11'

    SELECT datepart(m,CONVERT(datetime, @string))

    ---------------------------------------------------------------------------------

  • RE: Identify the row / value that caused a conversion / out-of-range error?

    pesche_h (12/8/2009)


    Thank you very much for the hints, that works nicely, so far!

    However, is there also a solution for other conversions than date-conversions? (e.g. overflow when converting to smallint, conversion...

    ---------------------------------------------------------------------------------

  • RE: Identify the row / value that caused a conversion / out-of-range error?

    Checkout ISDate,

    http://msdn.microsoft.com/en-us/library/ms187347(SQL.90).aspx

    ---------------------------------------------------------------------------------

  • RE: Identify the row / value that caused a conversion / out-of-range error?

    How is your date stored in char data type, I mean the format? what is the conversion that you are doing?

    ---------------------------------------------------------------------------------

  • RE: Update Last Row Value NOT NULL

    ALZDBA has given you a good example. How'd you tell SQL Server what is the 'last' message?

    ---------------------------------------------------------------------------------

  • RE: Average of value for a period of timeinterval ,say every 4 hours

    Isnt it the same as,

    http://www.sqlservercentral.com/Forums/Topic829346-149-1.aspx

    I thought arun has answered it and u dint give any feedback on that thing there?

    ---------------------------------------------------------------------------------

  • RE: Update Last Row Value NOT NULL

    Hi James, good to see data in a consumable format but I am afraid the requirement you are giving is insufficient. Its an attempt to answer your question and give...

    ---------------------------------------------------------------------------------

  • RE: DateAdd together with DateDiff

    Not sure but these date functions handle these things, no?

    This,

    Select dateadd(mm,1, dateadd(day,0, datediff(day,0,'2010-01-29')))

    would give me the result,

    2010-02-28 00:00:00.000

    Edited: Ohh ignore it please Chris, I now got what...

    ---------------------------------------------------------------------------------

  • RE: How to find missing numbers in database

    You can use tally table also, does this help?

    I think it will return the last record also which is of no importance in this case,

    SELECT (U1.ROLLNO + 1)

    FROM ...

    ---------------------------------------------------------------------------------

  • RE: DateAdd together with DateDiff

    If the deadline is going to be one month ahead of the current date when the update is happening, then can you use this?

    sorry if I underestimated your requirement

    Select dateadd(mm,1,...

    ---------------------------------------------------------------------------------

Viewing 15 posts - 121 through 135 (of 463 total)