Jump to content

How can you generate a sysid with PHP?


Go to solution Solved by requinix,

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/315449-how-can-you-generate-a-sysid-with-php/
Share on other sites

  • Solution

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.

  • 2 weeks later...

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. 

 

 

 

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.