How to change CDC Function fn_cdc_map_lsn_to_time(__$start_lsn) to return UTC Datetime

  • Is there any possibilities on change the Return Datetime of sys.fn_cdc_map_lsn_to_time(__$start_lsn) to UTC date from local server time... 

    We will have to show modified date of transactions using CDC sys.fn_cdc_map_lsn_to_time(__$start_lsn)

    Thanks
    Ram

  • Is there any possibilities??

  • sram24_mca - Wednesday, January 2, 2019 2:58 AM

    Is there any possibilities??

    You are talking about modifying a Microsoft system object, not sure I would want to if I could.  Best bet is to wrap the call in a function that does the conversion to UTC.

  • Lynn Pettis - Wednesday, January 2, 2019 9:24 AM

    sram24_mca - Wednesday, January 2, 2019 2:58 AM

    Is there any possibilities??

    You are talking about modifying a Microsoft system object, not sure I would want to if I could.  Best bet is to wrap the call in a function that does the conversion to UTC.

     Can you just explain about this Best bet is to wrap the call in a function that does the conversion to UTC

  • sram24_mca - Sunday, January 6, 2019 10:42 PM

    Lynn Pettis - Wednesday, January 2, 2019 9:24 AM

    sram24_mca - Wednesday, January 2, 2019 2:58 AM

    Is there any possibilities??

    You are talking about modifying a Microsoft system object, not sure I would want to if I could.  Best bet is to wrap the call in a function that does the conversion to UTC.

     Can you just explain about this Best bet is to wrap the call in a function that does the conversion to UTC

    I don't know, after looking at the Microsoft Docs perhaps something like this:
    SELECT TODATETIMEOFFSET(sys.fn_cdc_map_lsn_to_time(__$start_lsn), DATEPART(TZOffset, SYSDATETIMEOFFSET()));

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

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