Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GUID questions

Status
Not open for further replies.

cpope

Programmer
Jul 7, 2000
58
US
I can be mistaken but if you use a uniqueidentifier as a primary key, and want to define a foreign key reference to it in another table, do you also use the "uniqueidentifier" type for the foreign key field?? I am guessing that the uniqueidentifier does not create a unique ID unless you physically tell it to using NewID()?? [sig][/sig]
 
Yes and yes. A table that references a GUID column on another table can have multiple rows with that same GUID (unless you've added a Unique constraint). Defining the column in your primary GUID-containing table with a Default of NEWID() is the simplest way to assign its value. [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top