Page 1 of 1

Conversion failed when converting from a character string to

Posted: 29.01.2009, 16:11
by Key
I have problem with iserted record to MSSQL 2005.

in SQL server :
---------
Column Name - ROWGUID
DateType - uniqueidentifier

in Delphi code:
--------
ZTable1.Insert;
ZTable1.FieldByName('SURNAME');
ZTable1.Post;
..... I canĀ“t fill column ROWGUID

->

---------------------------
Error!
---------------------------
Conversion failed when converting from a character string to uniqueidentifier
---------------------------
OK
---------------------------

Why?

Posted: 24.03.2009, 12:01
by JWBokx
Normaly the value for a uniqueidentifier is generated bij de server.
This can be done in a trigger, setting the default value for the field to newid().
Have you added persistent fields to the table component?
In that case Delphi will fill the field with something like '' (empty string).
And the default of the server is not used.

Why don't you use a Query component?
Then you just don't select the column, and the server will do de rest.

J.W. de Bokx