You can translate the question and the replies:

Insert colunm in SQLServer

Hi, How i format this colunm in DENODO for write back in SqlServer table? |COLUMN_NAME|DATA_TYPE|TYPE_NAME|COLUMN_SIZE|BUFFER_LENGTH|DECIMAL_DIGITS|NULLABLE|SQL_DATA_TYPE|SQL_DATETIME_SUB|CHAR_OCTET_LENGTH|ORDINAL_POSITION|IS_NULLABLE| ------------|---------|---------|-----------|-------------|--------------|--------|-------------|----------------|-----------------|----------------|-----------| |CATALOGO_ID| -2|timestamp| 8| 8| 0| 0| -2| 0| 8| 1| NO | I try this formats: - current_timestamp - cast('blob', cast(current_timestamp as text)) but i receive the error: Error in some access: the query could not be completed. BV_WRITE_BACK [BASE] [ERROR] BV_WRITE_BACK [JDBC WRAPPER] [ERROR] Error executing view. Received exception with message 'Cannot insert an explicit value into a timestamp column. Use INSERT with a column list to exclude the timestamp column, or insert a DEFAULT into the timestamp column.' BV_WRITE_BACK#0 [JDBC ROUTE] [ERROR] Received exception with message 'Cannot insert an explicit value into a timestamp column. Use INSERT with a column list to exclude the timestamp column, or insert a DEFAULT into the timestamp column.' Thanks
user
15-09-2020 13:40:21 -0400

1 Answer

Hi, The error you are receiving is generated by the SQL server when you try to insert a value for the **timestamp** data type column. According to [Microsoft’s documentation](https://docs.microsoft.com/en-us/sql/t-sql/data-types/rowversion-transact-sql?redirectedfrom=MSDN&view=sql-server-ver15), '**timestamp**' is a data type that exposes automatically generated, unique binary numbers within a database. timestamp is generally used as a mechanism for version-stamping table rows i.e it's automatically generated and guaranteed to be unique. The storage size is 8 bytes. The timestamp data type is just an incrementing number and does not preserve a date or a time. Hence, you cannot explicitly insert a value into a **timestamp** field and if you were intending to insert a value back into SQL Server, then you could drop the timestamp field and create a new field **CATALOG\_ID** with the datatype **datetime** in the SQL server and then do a [source refresh](https://community.denodo.com/docs/html/browse/latest/vdp/administration/creating_data_sources_and_base_views/source_refresh/source_refresh#source-refresh) on the respective base view. Once the field type is changed, you will be able to insert value for CATALOG\_ID column from Denodo to SQL server Hope this helps!
Denodo Team
17-09-2020 01:11:49 -0400
You must sign in to add an answer. If you do not have an account, you can register here