Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Hex String to Int And Back

Author  Topic 

kenchee
Starting Member

49 Posts

Posted - 2007-09-18 : 19:57:25
Hi,
can someone show me how to convert a hex string (varchar(13))eg. '44708AFE0003' to an integer and then back to hex string. I am trying to insert records into a table that has a hex string as it's primary key. that is why i need to convert the hex string to an integer and then increment it by 1 then convert it back to hex string and insert the record.

Table example.
----------------------
pk
------------
44708AFD0014
44708AFD0015
44708AFD0016
44708AFD0017
44708AFD0018


thanks

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-09-18 : 23:02:26
http://sqlblog.com/blogs/peter_debetta/archive/2007/03/09/t-sql-convert-hex-string-to-varbinary.aspx

hint: google is your friend.




elsasoft.org
Go to Top of Page
   

- Advertisement -