The different objects in GP have their own formats for the bus key, some examples follow. The notes attachments use the funky hex versions of the integer record reference, others use the pain record keys such as the one you are talking about.
In Dex there is a method on the window to call to do the conversion, in SQL we don't have that, although I'm getting tempted to write one! Work flow has a procedure (that I used to get list below), but it only covers objects that work flow interfaces with, so falls short as a comprehensive list.
So basically define your own function or procedure to do the conversion, based on the object type it is for.
---------------------------------------------------------------------------------------------------------------------
'0\PM\Purchase Order\' + ltrim(rtrim(@Key1))
'0\PM\Requisition\' + ltrim(rtrim(@Key1))
'0\UPR\Timecard\' + ltrim(rtrim(@Key1)) + '~' + ltrim(rtrim(@Key2)) + '\' + ltrim(rtrim(@Key3)) + '\' + ltrim(rtrim(@Key4))
'0\PM\Vendor Maintenance\' + ltrim(rtrim(@Key1))
'258\PA\PTE Timesheet\' + ltrim(rtrim(@Key1))
'258\PA\PTE Expense Report\' + ltrim(rtrim(@Key1))
'0\UPR\ESS Employee Profile\' + ltrim(rtrim(@Key1)) + '~' + ltrim(rtrim(@Key2)) + '\' + ltrim(rtrim(@Key3))
'0\UPR\ESS W4\' + ltrim(rtrim(@Key1)) + '~' + ltrim(rtrim(@Key2))
'0\UPR\ESS Direct Deposit\' + ltrim(rtrim(@Key1))
'0\UPR\ESS Employee Skills\' + ltrim(rtrim(@Key1)) + '~' + ltrim(rtrim(@Key2)) + '\' + ltrim(rtrim(@Key3))
'0\PM\Payables Transaction\' + (LTRIM(RTRIM(str(DOCTYPE))) + '~' + VCHNUMWK)
there are many more and 3rd party products too!