I received this error while deploying a Visual Studio SQL Server DBProject
DBProj.dbschema(0,0): Warning SQL01271: The unnamed foreign key between tables [dbo].[Match] and [dbo].[Team] will be checked by checking the table. Name the foreign key to avoid checking the entire table and only check the new constraint.
My table definition is
CREATE TABLE [dbo].[Match]
(
MatchID int identity(11,2) PRIMARY KEY,
TournamentID int not null REFERENCES Tournament(TournamentID),
Team1_ID int not null REFERENCES Team(TeamID),
Team2_ID int not null REFERENCES Team(TeamID),
MatchDate date,
MatchTime time
)
CREATE TABLE [dbo].[Team]
(
TeamID int PRIMARY KEY,
TeamName varchar(50)
)
UPDATE: Unnamed constraints
If you do not specify a name, SQL will generate a random name built from a prefix which denotes the type of constraint, and partial table and column names followed by a random alphanumeric string. It would normally look something like this: DF_MyTable_MyColu__3F3159AB
Everytime the DBProject is rebuilt and deployed this process is repeated generating a new set of random constraint names
What does this error means? What is the implication? Especially, Name the foreign key to avoid checking the entire table and only check the new constraint.
Information about this question, for me, is hard to come by. So far, I have been able to find some new information on constraints and I can say I have learnt more.
Posting this same question on dba.SE.com and I got this response
.
.