OUTPUT SQL PLugin

dear All,
i have a telegraf agent woth modbus plugin and i qould like to write the data to mssql server.
I tried to configure the output sql plugin but it fails to write data. i do not understand how configure it to check if table exist or create it and how to map the read value to column.

thi is telegraf file configuration

[[outputs.sql]]

driver="mssql"
timestamp_column = "timestamp"
data_source_name = "sqlserver://sa:xx@xxx.yyy.zzz.kkkk:1433/?database=test&connection+timeout=30

[[inputs.modbus]]
        name = "PM5300_SAS"
        slave_id = 255
        timeout = "2s"
        controller = "tcp://10.0.2.103:502"

        configuration_type  = "register"

        holding_registers=[
                { name = "VAB", byte_order = "ABCD",data_type = "FLOAT32-IEEE",scale=1.0, a>
                { name = "VAC", byte_order = "ABCD",data_type = "FLOAT32-IEEE",scale=1.0, a>
                { name = "VBC", byte_order = "ABCD",data_type = "FLOAT32-IEEE",scale=1.0, a>
                ]

telegraf as created a table but cant write the value on it , the error is

[agent] Error writing to outputs.sql: mssql: Incorrect syntax near ','.

is there somebody can help me?

Hello @Rosario_Iameo,
Can you please enable logs with:

[agent]
  debug = true

Can you try automatically creating the table first two and verifying that your columns match?

Hello @Anaisdg ,
telegraf create this table

and after a creation the error is

 [agent] Error writing to outputs.sql: execution failed:                                                                                                               mssql: 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 time                                                                                                              stamp column.

@Rosario_Iameo how about adding the closing quote to data_source_name? :wink:

this is an copy error but in the origial file the data_source_name is correct and with opening e closing quote :slight_smile: