Forum Replies Created

Viewing 15 posts - 46 through 60 (of 95 total)

  • RE: SP for Difference between Dates in Years.Days format

    Phil,

    This could be expected, I just wanted to point this out to the OP.

  • RE: SP for Difference between Dates in Years.Days format

    Noticed something when I was doing some testing.

    Adding 1 year to 2012-02-29 returns 2013-02-28

    SELECT dateadd(year, 1, '20120229')

  • RE: SP for Difference between Dates in Years.Days format

    Didn't think about leap years in the calculation,

    This one might be better,

    DECLARE @D1 DateTime = '20110228',

    @D2 DateTime = '20130227';

    DECLARE @Years int = datediff(year, @D1, @D2);

    DECLARE @Days int =...

  • RE: SP for Difference between Dates in Years.Days format

    You can start with this calculation:

    DECLARE @D1 DateTime = '20090128',

    @D2 DateTime = '20150217';

    SELECTCAST (

    ...

  • RE: Odd Man Out

    ROWCOUNT_BIG returns the number of rows affected by the last statement all the others return values in the result set itself (Aggregate or sequential)..

    for me ROWCOUNT_BIG was the odd one...

  • RE: Formatted output

    Extra careful, as always..

    BTW. Koen, we're not far apart, I'm in Kortenberg.

  • RE: Formatted output

    Koen Verbeeck (10/29/2014)


    Nice question, thanks.

    A bit curious as why you use DATALENGTH instead of just LEN.

    With DATALENGTH you can also use a space as the separator, LEN strips trailing spaces.

    DECLARE...

  • RE: Create a stored procedure

    I also chose 'none of the above' , which in my opinion is the correct answer for this QOTD, even if it's not the intention of the author.

  • RE: Supported spatial data formats

    Hugo Kornelis (9/24/2014)


    What, all those links but none for further reading on CHTM? I am disappointed!

    Nobody seems to have any clue about the skulls and bones data type.

    Seems to be...

  • RE: Supported spatial data formats

    Iulian -207023 (9/24/2014)


    Nice question , good spot.

    Louis Hillebrand (9/24/2014)


    I need to import from CHTM data format, any suggestions? 😉

    Assuming CHTM is Compiled HTML is this context, convert the...

  • RE: Supported spatial data formats

    I need to import from CHTM data format, any suggestions? 😉

  • RE: Merge Targets

    Updating the source of the merge ??, please correct the answer !

  • RE: Data from one Table to Two Columns

    Assuming there is a logout following the login, you can try this :

    I recreate the order of the logging with ROW_NUMBER().

    WITH cte (DRIVER_ID, LOGGED_DATETIME, IS_LOGGED_IN, R) AS (

    SELECTDRIVER_ID,

    LOGGED_DATETIME,

    IS_LOGGED_IN,

    ROW_NUMBER() OVER( PARTITION...

  • RE: Parameter Sniffing

    Today the procedure again ran with the slow execution plan, taking 2 minutes to run...

    I rebuild the procedure using a temporary table with the selected QuotationId's and no select...

  • RE: Parameter Sniffing

    Chris,

    Here is the execution plan..

    The OUTER APPLY does 100k seeks on the Follow-Up table.

    Louis.

Viewing 15 posts - 46 through 60 (of 95 total)