Forum Replies Created

Viewing 15 posts - 3,886 through 3,900 (of 8,761 total)

  • RE: Convert a Date

    spaghettidba (1/25/2016)


    Eirikur Eiriksson (1/25/2016)


    spaghettidba (1/25/2016)


    Eirikur Eiriksson (1/25/2016)


    spaghettidba (1/25/2016)


    SQL Server 2012 supports the FORMAT function:

    select format(GETDATE(), 'dd-MMM-YYYY')

    Gianluca, don't use the format function, it has terrible performance.

    😎

    It is a CLR function, so...

  • RE: Convert a Date

    Quick test set, similar results to the one Jeff posted

    😎USE tempdb;

    GO

    SET NOCOUNT ON;

    IF OBJECT_ID(N'dbo.TBL_DATES') IS NOT NULL DROP TABLE dbo.TBL_DATES;

    CREATE TABLE dbo.TBL_DATES

    (

    TD_DATE DATETIME ...

  • RE: Convert a Date

    Luis Cazares (1/25/2016)


    ben.brugman (1/25/2016)


    Luis Cazares (1/25/2016)


    the problem often relies on keeping the default (us_english)

    I do strongly object to the notion that the default language is English.

    I know in almost...

  • RE: RECREATE AN ID OF A ROW AFTER BEING DELETED

    JustMarie (1/25/2016)


    The ONLY business reason I can think of for this situation is a legal requirement that there be no gaps in the numbering. There's a vague memory of...

  • RE: Convert a Date

    spaghettidba (1/25/2016)


    Eirikur Eiriksson (1/25/2016)


    spaghettidba (1/25/2016)


    Eirikur Eiriksson (1/25/2016)


    spaghettidba (1/25/2016)


    SQL Server 2012 supports the FORMAT function:

    select format(GETDATE(), 'dd-MMM-YYYY')

    Gianluca, don't use the format function, it has terrible performance.

    😎

    It is a CLR function, so...

  • RE: Convert a Date

    spaghettidba (1/25/2016)


    Eirikur Eiriksson (1/25/2016)


    spaghettidba (1/25/2016)


    SQL Server 2012 supports the FORMAT function:

    select format(GETDATE(), 'dd-MMM-YYYY')

    Gianluca, don't use the format function, it has terrible performance.

    😎

    It is a CLR function, so there's a startup...

  • RE: WITH Recompile VS Option Recompile , With Recompile performs worse?

    If I'm reading this correctly then the sproc returns sales by either a product, a customer or both. This kind of code is not likely to benefit from recompilation as...

  • RE: Convert a Date

    spaghettidba (1/25/2016)


    SQL Server 2012 supports the FORMAT function:

    select format(GETDATE(), 'dd-MMM-YYYY')

    Gianluca, don't use the format function, it has terrible performance.

    😎

  • RE: Convert a Date

    Quick suggestion

    😎

    DECLARE @TD DATETIME = GETDATE();

    SELECT CONCAT(DAY(@TD),CHAR(45),SUBSTRING(UPPER(DATENAME(MONTH,@TD)),1,3),CHAR(45), YEAR(@TD));

  • RE: Temp Table column suddenly becomes NOT NULL ???

    Brandie Tarvin (1/22/2016)


    ... I have a bit of code that monitors my database growth.

    Quick question, are you intentionally returning one row for each database file?

    😎

  • RE: Temp Table column suddenly becomes NOT NULL ???

    Here is an alternative method for collecting this (almost the same) information in a single dynamic sql query.

    😎

    DECLARE @SQL_STR NVARCHAR(MAX) = N'';

    DECLARE @OUTER_SQL NVARCHAR(MAX) = N'

    ;WITH...

  • RE: RECREATE AN ID OF A ROW AFTER BEING DELETED

    Hugo Kornelis (1/23/2016)


    Eirikur Eiriksson (1/23/2016)


    Ed Wagner (1/23/2016)


    Eirikur Eiriksson (1/23/2016)


    Ed Wagner (1/23/2016)


    Piling on, I have to agree with the majority opinion here - this is a bad idea. If you're...

  • RE: Are the posted questions getting worse?

    Ed Wagner (1/23/2016)


    Eirikur Eiriksson (1/23/2016)


    ChrisM@Work (1/22/2016)


    Ed Wagner (1/22/2016)


    Greg Edwards-268690 (1/21/2016)


    Eirikur Eiriksson (1/21/2016)


    Greg Edwards-268690 (1/21/2016)


    Steve Jones - SSC Editor (1/21/2016)


    Greg Edwards-268690 (1/21/2016)


    It seems he has an elephant on the menu, and...

  • RE: Are the posted questions getting worse?

    Ed Wagner (1/23/2016)


    Eirikur Eiriksson (1/23/2016)


    Ed Wagner (1/23/2016)


    jasona.work (1/22/2016)


    So I just had an amusing moment...

    I'm checking my servers for DBs that aren't TDE enabled and I come across a DB I...

  • RE: RECREATE AN ID OF A ROW AFTER BEING DELETED

    Ed Wagner (1/23/2016)


    Eirikur Eiriksson (1/23/2016)


    Ed Wagner (1/23/2016)


    Piling on, I have to agree with the majority opinion here - this is a bad idea. If you're going to reuse IDs...

Viewing 15 posts - 3,886 through 3,900 (of 8,761 total)