distal-attribute
distal-attribute
distal-attribute
distal-attribute

SQL Error (529): Explicit conversion from data type timestamp to nvarchar is not allowed.

User, date Message
Written by python_dev
1 year ago
Category: General
1 posts since Tue, 23 Jul 13
I have multiple tables with timestamps, so the end result of this error is I cannot access the data tab of any of them connected to MSSQL database. I have to manually change the query to VARCHAR instead of NVARCHAR in order to see data in the tables and run as a query..
Is there any way to turn this off????
Written by ansgar
1 year ago
4986 posts since Fri, 07 Apr 06
The MSSQL TIMESTAMP data type is currently sorted into the binary type category. This is wrong I guess, and it's the cause for why HeidiSQL applies a LEFT(CAST()) to it in the data tab.

So, I will need to move that TIMESTAMP data type into the right category. But I'm having problems in understanding Microsoft's intention for timestamp columns. It's not a simple number, and it's not a readable string, end even not some date/time format. If I insert some row in a table with a timestamp, that timestamp value is auto-filled with some binary character. How does HeidiSQL need to display such values? I guess I must do some internal conversion?
Written by jfalchMoney, Euro
1 year ago
386 posts since Sat, 17 Oct 09
ahem; thus, most probably cast to int.
Written by sspnetMoney, Euro
9 months ago
1 posts since Thu, 10 Jan 13
I am having the same problems with MsSQL tables with timestamp fields.

Did you get any further finding the solution?
Written by ansgar
9 months ago
4986 posts since Fri, 07 Apr 06
I'm still not sure if it will run without any CAST and LEFT call, but I'm going to test that. The posts on stackoverflow says it's a "binary representation of a consecutive number". So probably I have to cast to INT or so.
Written by ansgar
9 months ago
4986 posts since Fri, 07 Apr 06
This gives me some cosecutive numeric value in a TIMESTAMP column:

SELECT CAST("Column 2" AS INT) FROM "anse"."dbo"."foo";


However, attempts to update a TIMESTAMP column seems to be impossible:

update "anse"."dbo"."foo" set "Column 2"=34007 where "Column 2"=34006
>> SQL Error (272): Cannot update a timestamp column.



But I guess it's ok if at least the value can be seen without triggering some error.
Written by ansgar
9 months ago
4986 posts since Fri, 07 Apr 06
Should work now without errors, in r4673.
 

Please login to leave a reply, or register at first.