Loading dates US style when I want UK style

  • Hi, I have two questions about DTS - hopefully easy:

    1) I have a production database and a UAT (user acceptance test) database. I'm trying to load a UK style date (i.e. dd/mm/yyyy 00:00:00) from a flat file. When the date lands in the destination table in UAT the date loads OK (i.e. UK style). However, when I load exactly the same data file into production, the date loads in US style (i.e. mm/dd/yyyy 00:00:00).

    Looking at the DTS script, there is a simple source to destination link in the Transformation and no additional programming. The datatype of the column is smalldatetime. I have checked the properties and all aspects are identical including the collation. Does anyone know what I can check or do to get UK style dates in my production database?

    2) I'm looking at a completely different DTS script and it looks like spaghetti filling the whole screen. How can you tell what the first step is? I feel sure that once I have found the first step, then it should be reasonably straight forward to follow the process flow.

    Many thanks!

  • If there is no difference between the DTS jobs, check both servers using the DBCC USEROPTIONS command... look for what the setting in the "dateformat" setting is. Compare the setting between the UAT and the Production servers.

    In the meantime... I'm no DTS guru by any means... any of you DTS gurus out there have any idea how to help?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Hi Jeff,

    I've run the "DBCC USEROPTIONS" command in both environments and the date is "mdy" in both UAT and PRODUCTION. Strange, considering we're a UK site!

    Does anyone know whether date formatting can be set or overrided at the DTS script level?

    Thanks.

  • Replace the Copy Column data transformation with a Date Time String transformation.

    On the General tab of this transformation type's details, click the Properties button and enter the date time format you want.

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

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