Datefirst

  • Comments posted to this topic are about the item Datefirst

  • Thanks 🙂

    Thanks
    Vinay Kumar
    -----------------------------------------------------------------
    Keep Learning - Keep Growing !!!

  • Very nice question to close off the week.

    And kudos for mentioning the default language, so there's less whining in the discussion 😀

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Clear and easy question!

    Thanks:-)

  • Carlo Romagnano (9/13/2013)


    Clear and easy question!

    Thanks:-)

    +1

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • The scope of "set language" and "set datefirst" is per session and also per procedure/function

    Try this:

    create procedure proc_datefirst

    as

    set language 'us_english'

    select @@DATEFIRST

    go

    set language 'Italian'

    exec proc_datefirst

    select @@DATEFIRST

  • This was removed by the editor as SPAM

  • Good one, thank you for the post.

    (so close, and I got this wrong :crying:. Note to self: "connection" and "session" are two different things.)

    ww; Raghu
    --
    The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.

  • Carlo Romagnano (9/13/2013)


    The scope of "set language" and "set datefirst" is per session and also per procedure/function

    Try this:

    create procedure proc_datefirst

    as

    set language 'us_english'

    select @@DATEFIRST

    go

    set language 'Italian'

    exec proc_datefirst

    select @@DATEFIRST

    Easy question...

  • Interestingly enough running this in UK, on SQL Server 2012 SP1

    I got

    us_english

    7

    2

    3

    tried it on two 2012 builds got the same result.

    Also same result on 2008 R2 dev edition.

    And on 2008 sp 3 enterprise edition.

    Cheers,

    Rodney

  • Silly me, didn't have coffee yet and missed the second part!

    Yes per session!! So new session will be 7

    Rodders...

  • Thanks! I will be posting some more in the future. I'm glad you liked it! 😉

  • Thanks for the question!

    BTW, I got tired of seeing Steve go on vacation. So, I'm going on one too. Two weeks in Greece, or ????da. The ONLY thing I'll miss about work is doing the QotD every morning. 😉

    [font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
    Connect to me on LinkedIn

  • Interesting, good question...

  • Great question to end the week on



    Everything is awesome!

Viewing 15 posts - 1 through 15 (of 29 total)

You must be logged in to reply to this topic. Login to reply