>I'm not running this command in VFP. I need a SQL Function to do this job so that when the SQL query is executed the value returned is the HEX version.
Sorry, didn't pay attantion to the Forum.
It can be done with an undocumented system stored procedure xp_varbintohexstr .
DECLARE @id int, @String varchar(32)
DECLARE @Id_vb varbinary(12)
SET @id = 1439
SET @Id_vb = CAST( @Id AS varbinary(12))
EXEC xp_varbintohexstr @id_vb,
@string OUTPUT
SELECT @string
--sb--