转自:https://www.cnblogs.com/CoffeeHome/archive/2014/06/04/3767501.html 这里powerdesigner连接的数据库是以mysql为例子,连接其他数据库时操作也基本类似 1.设置主键为自增字段 双击要设置的表,选择“Columns”标签,双击主键字段,在弹出的新窗口的General标签最下方,勾选Identiry即可 2.设置非主键为唯一键,并作为表的外键 2.1.双击要设置的表,选择“keys”标签,点击“Iinsert a r
问: In SQL Server , I got this error -> "There are no primary or candidate keys in the referenced table 'BookTitle' that match the referencing column list in the foreign key 'FK_BookCopy_Title__2F10007B'." I first created a relation called the
-- 声明使用数据库use 数据库;go -- 添加主键(primary key)约束-- 基本语法-- 判断主键约束是否存在,如果存在则删除,不存在则添加if exists(select * from sysobjects where name=主键名) alter table 表明 drop constraint 主键名;go alter table 表明 add constraint 主键名 primary key(列名) use SapDBT;go-- 实际例子 if exists(se