关于Enterprise Architect生成SQL 2005的DDL出错的问题

在使用EnterpriseArchitect生成SQL Server 2005的DDL时遇到输出为Oracle语法的问题,该问题是由于软件版本较低所致。在V7(815)版本中此问题已被修复。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天运行Enterprise Architect生成SQL 2005的DDL,马上就一大堆错误,打开一看,几乎晕倒,输出的语句竟然是Orcale的,开始我还怀疑自己设置错误了,但设置成SQL 2000就一切正常,就是选择SQL 2005出问题,上官网细看更新日志,才发现,这原来是个BUG,在V7(815)中才修复,我使用的是V7(813)版本,真是纳闷,幸好更新的了版本就可以,如果使用SQL 2005的朋友记得把EA更新到V7(815)以上的版本哦 :)

V7(815) 更新log:

http://www.sparxsystems.com/cgi-bin/yabb/YaBB.pl?board=Latest;action=display;num=1186123583

 Version 7.0 - Released (Build 815)
 on: Aug 2nd, 2007, 9:46pm 

--------------------------------------------------------------------------------
Release Notes for EA 7.0 Build 815
**********************************
Added support for round-tripping alternate-images using XMI 1.1 and XMI 2.1 during XMI Export/Import and Batch XMI Export/Import
Added support for importing the attribute "mixed" on complexTypes and multiplicity on associations to modelGroups from XML Schema
Added capability to save a project reference that defines what to open in the model.
Added Model Patterns Task Page to provide support for using UML Patterns defined in MDG Technologies.
Added capability of showing searches run from a hyperlink to the output window.
Added support for batch export of 'Rational Rose/Unisys UML 1.3'. 
 
General Improvements
  Sequence message validation to allow messages within scope after delete messages.
  Usability of self messages just loaded or created on a sequence diagram.
  XMI 2.1 export of operation pre/post-conditions.
  XMI 1.2 generation of stereotypes 
  XMI import of very large files.
  XMI round trip of tagged values start and ending with pair of chevrons.
  Rendering of thick collaboration borders to metafiles.
  Result of canceling a diagram save.
  Selection of text in internal source editor.
  Undo behavior for new and removed connectors.
  Result of not saving a diagram after objects are added.
  Sizing of objects with an alternate image.
  Import of XSD and WSDL containing comments.
  Sort order of diagrams generated under elements in rtf generation.
  Behavior of file types when saving a diagram as an image.
  Drawing of names for composite elements with an alternate image.
  Loading of multiple sets of templates from a file based MDG technology.
  Profiles extending Forks and Joins.
  Handling of code and transform templates containing unicode characters.
  Saving of diagram at very low zoom level.
  Adjusting of tree sorting.
  DDL generation for SQL Server 2005.
  Propagation of column datatypes changes to indexes.
  Merge of tagged values when applying a UML Pattern.
 
Other Changes
  Changed behavior to allow double click on non-selectable elements.
  Corrected diagram attribute/operation visibility on Oracle repositories with German and Spanish regional settings.
  Corrected missing security permissions on Oracle repositories with German and Spanish regional settings.
  Resolved issue where tablespace not displayed on table properties dialog.
  Corrected behavior with calls to deprecated methods in the Automation Interface to prevent issues with loading MDG Technologies via Addin.
  Changed behavior with applying stereotypes to prevent redundant error messages being displayed.
  Fixed drawing issue when the Toolbox and Taskpanes are docked together in a floating window.

### 使用Enterprise Architect创建网上花店系统ER图 #### 工具简介 Enterprise Architect 是一款功能强大的建模工具,适用于多种类型的软件开发项目。由于名称中的“Enterprise”和“Architect”,在搜索引擎中查找特定于该工具的信息可能会遇到困难[^1]。 #### 准备工作 启动 Enterprise Architect 后,在新建或打开现有项目的基础上准备构建新的 ER 图文档。确保选择了支持数据库设计的功能包,通常位于 UML Profile 中的数据管理部分。 #### 创建实体关系图 (ERD) ##### 新建数据模型 通过菜单栏选择 `File -> New Model` 或者右键点击项目的根节点并选择 `Add Package` 来增加一个新的包用于存储即将绘制的 ER 图。命名此包为 "Online Flower Shop Database Design". ##### 添加实体对象 进入刚刚建立的数据模型包内,利用左侧面板提供的图形库来拖拽 “Entity” 实体图标到中心的工作区。对于一个典型的在线花卉销售平台而言,可能涉及如下几个核心实体: - **Customer**: 客户信息表,包含客户ID、姓名、联系方式等字段; - **Order**: 订单详情表,记录订单编号、下单时间戳以及总价款等属性; - **Product**: 商品资料表,列举商品编码、描述文字及其单价等内容; - **Category**: 类目分类表,定义各类鲜花所属类别; - **Payment**: 支付状态跟踪表,保存支付方式及确认标志位等参数。 每添加完一个实体之后,双击它以编辑其内部结构——即设置各个列的名字与类型,并指定主键(Primary Key)。这一步骤至关重要,因为后续的关系设定依赖于此处配置的关键字匹配情况。 ##### 建立联系线 完成上述操作后,下一步就是描绘这些实体之间的逻辑关联了。同样借助左侧工具箱里的连线选项,可以轻松地把不同实体间建立起一对一(One-to-One),一对多(One-to-Many)或是多对多(Many-to-Many)形式的映射路径。比如,“Order” 和 “Customer” 可能存在一种外键约束(Foreign Key Constraint),表明每一个订单都归属于某一位具体的顾客;而 “Product” 则可以通过中间件表同 “Category” 形成双向链接,表示多个产品可归属同一类目之下。 ##### 导出SQL脚本 当整个 ER 图搭建完毕并通过审查无误时,可以选择将其转换为实际可用的 SQL DDL(Data Definition Language)命令序列。具体做法是在顶部导航条里找到相应的按钮执行导出动作,这样就能得到一份完整的DDL文件供 MySQL 数据库初始化使用[^2]. ```sql CREATE TABLE Customer ( customer_id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(50), contact_info TEXT NOT NULL ); CREATE TABLE Category ( category_id INT AUTO_INCREMENT PRIMARY KEY, description VARCHAR(255) ); CREATE TABLE Product ( product_id INT AUTO_INCREMENT PRIMARY KEY, title VARCHAR(100), price DECIMAL(8, 2), category_id INT, FOREIGN KEY (category_id) REFERENCES Category(category_id) ); ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值