Avatar of Bill Park
Bill Park
Flag for United States of America

asked on 

SQL Server - create a function that takes an int as an argument and returns a formatted hexidecimal based string.

I need a Transact SQL function that works as follows:

func_x(1) returns '000000000001'
func_x(255) returns '0000000000FF''

In other words, mac IDs without hyphens or colons.
Going from int to hex was easy, hung up on the rest.
Current SQL.

Thank you.

SQLMicrosoft SQL Server

Avatar of undefined
Last Comment
Ryan Chong

8/22/2022 - Mon