sen5241b Posted October 22, 2022 Share Posted October 22, 2022 I worked with ServiceNow for many years. They have a very interesting database. Every record in the entire data base has a field called the sysid. This number combined with a table name makes that record unique amongst all the ServiceNow databases in the entire world. if you transfer a data record from your ServiceNow database into any other ServiceNow database in the world that sysid will remain the same. i’m trying to create a function to do this with PHP. how would you even do that? Quote Link to comment https://forums.phpfreaks.com/topic/315449-how-can-you-generate-a-sysid-with-php/ Share on other sites More sharing options...
Solution requinix Posted October 22, 2022 Solution Share Posted October 22, 2022 I know an application with lots of database tables. Each record has a blargh identifier that is unique across all blarghs in the world. Do you think they're the same as sysids? I can't tell you how to create a "sysid". I can tell you about things like UUIDs. Quote Link to comment https://forums.phpfreaks.com/topic/315449-how-can-you-generate-a-sysid-with-php/#findComment-1601868 Share on other sites More sharing options...
ginerjm Posted October 23, 2022 Share Posted October 23, 2022 I would think that if this value is promised to be unique all over the world that the company using and relying on them would be the ONLY place that one that fits could be created. Not you. Quote Link to comment https://forums.phpfreaks.com/topic/315449-how-can-you-generate-a-sysid-with-php/#findComment-1601870 Share on other sites More sharing options...
sen5241b Posted November 1, 2022 Author Share Posted November 1, 2022 Did a little research. A ServiceNow sys_id is a 32 character universally unique ID (UUID). The Servicenow sys_id Is however a little bit different than a typical UUID. The sys_id must be combined with the table name to uniquely identify a specific record in any Servicenow database anywhere in the world. i’ve never written a UUID generator but I can tell you that none of them are perfect. GUID and UUID are the same thing. They’re are plenty of PHP algorithms to generate UUIDs out there. Quote Link to comment https://forums.phpfreaks.com/topic/315449-how-can-you-generate-a-sysid-with-php/#findComment-1602116 Share on other sites More sharing options...
requinix Posted November 1, 2022 Share Posted November 1, 2022 If UUIDs aren't unique enough, then what's so special about the table name to make it so? Quote Link to comment https://forums.phpfreaks.com/topic/315449-how-can-you-generate-a-sysid-with-php/#findComment-1602117 Share on other sites More sharing options...
NotionCommotion Posted November 1, 2022 Share Posted November 1, 2022 I am pretty sure I can guess your table names before I can guess your UUIDs. ULIDs are another option, and while I think they might be less likely to have conflicts than UUIDs (UUIDs have 1 in 1,000,000,000,000,000,000,000 odds of a duplicate), they provide other benefits. Quote Link to comment https://forums.phpfreaks.com/topic/315449-how-can-you-generate-a-sysid-with-php/#findComment-1602118 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.