4

如果我通过 VS2010 创建 SQL Express 数据库,我可以创建图表并通过这种方式设置外键关系。紧凑型数据库中的情况是什么?对于这种类型的数据库,服务器资源管理器中没有这样的选项。

4

2 回答 2

5

Yes there is. In Server Explorer, right click the table, select Table Properties, and use Add Relations view. Remember to press the "Add Relation" button to actually add the releation

于 2012-11-05T11:09:31.647 回答
0

演练:创建 SQL Server Compact 3.5 数据库

在上一个过程中创建的表之间创建关系

  1. 在服务器资源管理器/数据库资源管理器中,展开表。
  2. 右键单击订单表,然后单击表属性。
  3. 单击添加关系。
  4. 在关系名称框中键入 FK_Orders_Customers。
  5. 在外键表列列表中选择 CustomerID。
  6. 单击添加列。
  7. 单击添加关系。
  8. 单击确定以完成该过程并在数据库中创建关系。
  9. 再次单击“确定”关闭“表属性”对话框。
于 2014-10-28T04:49:11.023 回答