Random milliseconds added to datetime

Hi Guys,

I’ve noticed that when setting a datetime variable using sysdate() wille generate a datetime2(7) kolom in MS SQL Server 2014.

The strange thing is when printing the variable in BODS, you will see

8280	8828	PRINTFN	8-12-2015 10:30:22	load_date: 2015.12.08 10:30:22

Notice the format: yyyy.mm.dd hh24:mi:ss

When I check the value in the database, the variable was stored as 2015.12.08 10:30:22.2990000

Where are the random millisecond coming from!?!?

When I set my datetime variable in BODS using the following, the value is always stored with 0000000 milliseconds.

$load_date = sql( 'stage_area', 'SELECT SYSDATETIME()' );

8280 8828 PRINTFN 8-12-2015 10:34:48 load_date: 2015.12.08 10:34:48
2015.12.08 10:34:48.0000000

Again, why MS SQL Server decides to add random millisecond when using sysdate() inside BODS? And is using the SYSDATETIME() method a save way to make sure the milliseconds are always 0000000



bas_vdl :netherlands: (BOB member since 2012-11-08)

Hi everyone,

I know this post has been created a long time ago but i get the exact same problem with BODS today.

I would like to know if someone know the answer to this problem,

Thank you very much,


tlawie :fr: (BOB member since 2020-02-25)