Hello, I'd like some help.
I have a table in SQL
called Client, which has as primary key a type uniqueidentifier
Ex:
Create table Cliente (
ClienteID uniqueidentifier not null,
Nome varchar(50)
)
I'd like to know how to FOREIGN KEY
using uniqueidentifier
.
I did this but it did not work.
Create table Locacao (
LocacaoId uniqueidentifier not null,
ClienteID uniqueidentifier not null,
);
ALTER TABLE Locacao add constraint FK_Locacao_Cliente_ClienteID FOREIGN KEY(ClienteID) REFERENCES Cliente(ClienteID);
If someone can help me I appreciate it.