I am trying to create a table like,
USE [labblyDabbly3455]
GO
CREATE TABLE [dbo].[daTableBang]
(
TableAID varchar FOREIGN KEY REFERENCES TableA(ID)
TableATitle VarChar FOREIGN KEY REFERENCES TableA(title)
TableAName varchar FOREIGN KEY REFERENCES TableA(Name)
TableASurName varchar FOREIGN KEY REFERENCES TableA(surname)
TableBID int FOREIGN KEY REFERENCES TableB(ID)
)
but getting error,
Incorrect syntax
I need to declare TableAID as primary key too, can someone help me with syntax plz
After i try voo answer i get this error,
There are no primary or candidate keys in the referenced table 'TableB' that match the referencing column list in the foreign key 'FK__0A537D18'.