Forum Discussion
How to use ROWGUIDs
how do you use ROWGUID’s in Practice
Hello Gary,
A ROWGUID is used in Merge replication = distrubuted databases over several localition/regions.
I don't know any other usefull use-case for it.
I am assuming that if I use the ROW GUID field in my query it would be faster. Is that true?
No, really not. It's a uniqueidentifier (Transact-SQL) - SQL Server | Microsoft Learn and needs 16 bytes for storage. As simple integer with IDENTITY (Function) (Transact-SQL) - SQL Server | Microsoft Learn needs only 4 bytes (for raw data + for index data); that's a 1/4. No, GUID will make it slower.
Thank you for your response!!.. I knew from my readings that was what it was, but I did not know if there was a system parameter or something to access the records the RowGUID relates to.
I have a database that I have been given RO access to and no schema so I am trying to reverse engineer the relationships so I can build reports and do queries
thanks again!
- olafhelperJun 27, 2023Bronze ContributorBetter use simple integer values for primary key, with a range of 4 billion possible numbers you have a wide range and small footprint; much better then a GUID.