TSQL – Add Foreign Key

TSQL – Add Foreign Key

Ecco un esempio di statement per aggiungere una Foreign Key (Chiave esterna) ad una tabella

ALTER TABLE dbo.Tabella_Ordini ADD CONSTRAINT FK_TabellaOrdini FOREIGN KEY ( Cd_Utente ) REFERENCES dbo.Tabella_Utenti ( Id_Utente ) ON UPDATE NO ACTION ON DELETE NO ACTION

Leave a Reply

Your email address will not be published. Required fields are marked *

Are you human? Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.