How do you create a foreign key relationship in a SQL Server CE (Compact Edition) Database?

前端 未结 7 729
闹比i
闹比i 2021-02-04 23:44

Visual Studio 2005 doesn\'t provide an interface for creating relationships between tables in a SQL Server CE database (I\'m using version 3.0) and you can\'t open a Compact Edi

7条回答
  •  醉话见心
    2021-02-05 00:26

    create table employee
    (
       empid int,
       empname varchar(40),
       designation varchar(30),
       hiredate datetime, 
       Bsalary int,
       depno constraint emp_m foreign key references department(depno)
    )
    

    We should have an primary key to create foreign key or relationship between two or more table .

提交回复
热议问题