SISS date default issue

  • Hi,

    I have read several articles/blogs that say a package uses the default settings of the account that runs the package. Perhaps someone can clear this up for me....

    If I have a scheduled package with the following scenario:

    Package creator: me

    Owner: sa

    Database connection within the package: specific account with read/write permission only

    SQL agent service: domain service account.

    Source date: text file with format ddmmyyyy

    Exppression to convert txt date to dt_date:

    TRIM(CW_DATE) == "01010001" ? NULL(DT_DATE) : TRIM(CW_DATE) == "" ? NULL(DT_DATE) : (DT_DATE)((SUBSTRING(CW_DATE,1,2) + "-" + SUBSTRING(CW_DATE,3,2) + "-" + SUBSTRING(CW_DATE,5,4)))

    No matter what default settings are on any of the accounts (us english or british english), the resulting date comes out in us_english format of mmddyyyy. This seems to contradict what I have read on various sql blogs/articles...could some please clear this up for me as well as explain which account the package will run under? 😉 I am totally confused! :unsure:

    I do realise that I could simply swap the 'mm' and 'dd' part of the expression to get the correct uk date, but it seems to me like it should not be neccessary. Does ssis dt_date somehow always default to mmddyyyy?

    Thanks!

    Jinx.

  • I've read similar questions like this one on this forum, but I've never seen an answer. (maybe I stopped checking the thread too early :-)).

    So I guess that it is SSIS that screws up the date. It makes sense, as SSIS is usually responsible when something is screwed up 😛

    I usually do my date formatting in T-SQL within SSIS, as it is much more powerful and flexible. And you can use the set dateformat command.

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

  • 😀

    Oh no!

    Suppose it's rearrange the expression then.*sigh*

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

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