NetTalk Central

Author Topic: GUID field naming  (Read 3519 times)

Ubaidullah

  • Full Member
  • ***
  • Posts: 125
    • View Profile
GUID field naming
« on: October 14, 2020, 03:01:11 AM »
Hi Bruce,

I am adding GUID fields to my tables. For Nettalk purposes, does it have to be named "GUID" or can it be like "ItemGUID", "CustomerGUID", etc. ?

Thanks
&
Regards,
Ubaidullah.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: GUID field naming
« Reply #1 on: October 14, 2020, 10:48:14 PM »
Hi Ubadullah,

the primary key field in each table should be named Guid.
Then foreign key fields can be named as table-guid.

For example
Customers
Guid  string(16)

Invoices
Guid   string(16)
CustomerGuid   string(16)  ! link to cus:Guid

Cheers
Bruce

Ubaidullah

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: GUID field naming
« Reply #2 on: October 15, 2020, 06:04:08 AM »
Thanks Bruce.

Should the primary key also be called GuidKey or can it be different? Reason being, on SQL, key names have to be unique across all tables in a database.

Regards,
Ubaidullah Nubar.

Ubaidullah

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: GUID field naming
« Reply #3 on: October 16, 2020, 05:52:20 AM »
Bruce, thanks for addressing this on yesterday's webinar.

I have now changed all primary key field names to GuidKey while using the External name to conform with SQL requirements.

Regards,
Ubaidullah Nubar.