English 中文(简体)
1. 建立系统表格的外国关键人物
原标题:Create a foreign key to system tables

我想用一栏编制表格:

IdRole
IdProcedure

想法是<代码> IdProcedure is a FK to sys.objects.

当我问:

SELECT * 
FROM sys.objects 
WHERE type= p 

劳动报酬:

ALTER TABLE dbo.CORE_ProcedureXRole
ADD CONSTRAINT FK_SysProcedure
FOREIGN KEY (IdProcedure)
REFERENCES sys.objects(object_id)

告诉我:

Foreign key FK_SysProcedure references invalid table sys.objects .

最佳回答

<代码>sys.objects 页: 1 该系统采用一种系统观点,并以专用服务器格式储存的数据为后盾。 如果你想要确保所储存的名称正确,则添加一个<条码>TRIGGER,以更新并插入处理核对事宜。

问题回答

暂无回答




相关问题
Export tables from SQL Server to be imported to Oracle 10g

I m trying to export some tables from SQL Server 2005 and then create those tables and populate them in Oracle. I have about 10 tables, varying from 4 columns up to 25. I m not using any constraints/...

SQL server: Can NT accounts be mapped to SQL server accounts

In our database we have an SQL server account that has the correct roles to access some of the databases. We are now switching to windows authentication and I was wondering if we can create a NT user ...

SQL Server 2000, ADO 2.8, VB6

How to determine if a Transaction is active i.e. before issuing Begin Transaction I want to ensure that no previous transaction are open.. the platform is VB6, MS-SQL Server 2000 and ADO 2.8

热门标签