I want to create a table with columns:
IdRole IdProcedure
the idea is that IdProcedure
is FK before sys.objects
.
When I create this query:
SELECT * FROM sys.objects WHERE type='p'
It works fine, but this one:
ALTER TABLE dbo.CORE_ProcedureXRole ADD CONSTRAINT FK_SysProcedure FOREIGN KEY (IdProcedure) REFERENCES sys.objects(object_id)
tells me:
The foreign key 'FK_SysProcedure' refers to the invalid table 'Sys.objects'.
source share