Skip to Content
-2

Insert timestamp into external MS SQL table using ABAP

Hi Expert,

We have a requirement for which we have to insert records in an MS SQL table. The table contains a field of type DATETIME. We need to fill that field with the actual date and time.

We have concatenated date and time in the format 'YYYY-MM-DD HH:MM:SS' and we are getting the dump 'SQL error 241 occurred while executing Native SQL.'.

We are looping on an internal table to insert each record 1 by 1.

Could you please help to find a solution for the timestamp?

Thanks,

Vitish.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jan 12, 2017 at 08:13 AM

    Hello Jelena,

    The issue is solved. The timestamp format should be 'YYYY-DD-MM HH:MM:SS' instead of 'YYYY-MM-DD HH:MM:SS'.

    Regards,

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 28, 2016 at 01:18 PM

    What have you tried so far? Google -> "SQL error 241" finds 400K+ entries, surely some of the posts should have triggered some ideas and further analysis. Ask the external database's DBA as well. It's not really an ABAP question.

    Add comment
    10|10000 characters needed characters exceeded