Skipping FOREIGN KEY constraint ‘%.*ls’ definition for temporary table. FOREIGN KEY constraints are not enforced on local or global temporary tables.

Error Message:
Skipping FOREIGN KEY constraint ‘%.*ls’ definition for temporary table. FOREIGN KEY constraints are not enforced on local or global temporary tables.

Severity level:

Description:
This informal message appears when you try to create a FOREIGN KEY constraint for a temporary table.

Consequences:
The T-SQL statement can be executed, but the part mentioned in the message will be left out.

Resolution:
Error of this severity level are errors, that do not cause the statement to stop. But not all commands in your statement have been executed.

Versions:
All versions of SQL Server.

Example(s):
USE tempdb;
GO
IF OBJECT_ID(‘tempdb..#t’) > 0
 DROP TABLE #t
GO
CREATE TABLE #t
(
 c1 INT
 CONSTRAINT FK_t_t1_c1 FOREIGN KEY REFERENCES #t(c1)
)
GO

Remarks:
In the above example we try to create a FOREIGN KEY constraint for a temporary table. This raises the error.




Related Articles :

  • No Related Articles Found

No comments yet... Be the first to leave a reply!

Software Reviews | Book Reviews | FAQs | Tips | Articles | Performance Tuning | Audit | BI | Clustering | Developer | Reporting | DBA | ASP.NET Ado | Views tips | | Developer FAQs | Replication Tips | OS Tips | Misc Tips | Index Tuning Tips | Hints Tips | High Availability Tips | Hardware Tips | ETL Tips | Components Tips | Configuration Tips | App Dev Tips | OLAP Tips | Admin Tips | Software Reviews | Error | Clustering FAQs | Performance Tuning FAQs | DBA FAQs |