Different server - different date settings ?!

  • Background:

    Got a table with a date field in it of smalldatetime

    This form part of a query run against the DB ending with ...

     Where d.[Date]='2004-08-10 00:00:00'

    Same DB items and same data on 2 different servers.  1 returns data, the other does not.

    Did some digging and it looks like date issues of sorts:

    If I run SELECT DATEPART(dw,GetDate()) on both I get 2 on the server where data is not returned and 3 on the one where it was.

    I appreciate that I can add the following statement to the top of my SP to get it to work:

    "set language us_english"

    However, I want to know where the difference is.

    From what I can see, all date settings are the same across both boxes.

    The only difference I can see is that the default collation types are different between the SERVERS.

    However these are then changed to be consistent when you then look at the collation types of the DB themselves.

     

    ANY IDEA AS TO WHERE/WHAT THE DIFFERENCES ARE ????

    MANY THANKS

    COLIN

  • Run DBCC USEROPTIONS to see any difference in servers.

  • Yup

    On one

    Language - British

    dateformat - dmy

    datefirst - 1

    On the other

    Language - us_english

    dateformat - mdy

    datefirst - 7

    Are these server options that can be altered to bring into line, or do we have to rebuild things ?

    cheers

  • Check SET DATEFIRST  and SET DATEFORMAT  commands in BOL.

    There is no server level configuration for datetime.

Viewing 4 posts - 1 through 3 (of 3 total)

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