Search code examples
sql-serverhistorianwonderware

INSERT Query SQL (Error converting data type nvarchar to (null))


I'm trying to run an INSERT query but it asks me to convert varchar to null. Here's the code:

INSERT Runtime.dbo.History (DateTime, TagName, vValue)
VALUES ('2015-09-10 09:00:00', 'ErrorComment', 'Error1')

Error message:

Error converting data type nvarchar to (null).

The problem is at the vValue column.

column vValue(nvarchar, null) 

How it looks in the database:

enter image description here

The values inside vValue are placed by the program I'm using. I'm just trying to manually insert into the database.

Last post was with the wrong column, I apologize.


Solution

  • After contacting Wonderware support i found out that INSERT is not supported on the vValue column by design. It’s a string value and updates are supposed to carry out via the StringHistory table.