使用PowerDesigner到处SQL脚本,执行出现问题,求救

lalafeng 2006-01-01 09:21:30
使用PowerDesigner到处SQL脚本,执行出现一下问题:



服务器: 消息 4902,级别 16,状态 1,行 7
无法更改表 'u_order',因为数据库 'test2' 中不存在此表。
服务器: 消息 4902,级别 16,状态 1,行 2
无法更改表 'u_order',因为数据库 'test2' 中不存在此表。
服务器: 消息 4902,级别 16,状态 1,行 2
无法更改表 'u_order',因为数据库 'test2' 中不存在此表。
服务器: 消息 4902,级别 16,状态 1,行 2
无法更改表 'u_product',因为数据库 'test2' 中不存在此表。
服务器: 消息 4902,级别 16,状态 1,行 2
无法更改表 'u_product',因为数据库 'test2' 中不存在此表。
服务器: 消息 4902,级别 16,状态 1,行 2
无法更改表 'u_product',因为数据库 'test2' 中不存在此表。
服务器: 消息 4902,级别 16,状态 1,行 2
无法更改表 'u_productPartType',因为数据库 'test2' 中不存在此表。
服务器: 消息 4902,级别 16,状态 1,行 2
无法更改表 'u_productPic',因为数据库 'test2' 中不存在此表。
服务器: 消息 4902,级别 16,状态 1,行 2
无法更改表 'u_productVenditionLog',因为数据库 'test2' 中不存在此表。
服务器: 消息 4902,级别 16,状态 1,行 2
无法更改表 'u_productVenditionLog',因为数据库 'test2' 中不存在此表。
服务器: 消息 4902,级别 16,状态 1,行 2
无法更改表 'u_shoppingCar',因为数据库 'test2' 中不存在此表。
服务器: 消息 4902,级别 16,状态 1,行 2
无法更改表 'u_shoppingCar',因为数据库 'test2' 中不存在此表。
服务器: 消息 4902,级别 16,状态 1,行 2
无法更改表 'u_user',因为数据库 'test2' 中不存在此表。







脚本:

alter table u_order
drop constraint FK_U_ORDER_REFERENCE_U_USER
go

alter table u_order
drop constraint FK_U_ORDER_REFERENCE_U_PAYMOD
go

alter table u_order
drop constraint FK_U_ORDER_REFERENCE_U_TRANSP
go

alter table u_product
drop constraint FK_U_PRODUC_REFERENCE_U_FACTOR
go

alter table u_product
drop constraint FK_U_PRODUC_REFERENCE_U_BRAND
go

alter table u_product
drop constraint FK_U_PRODUC_REFERENCE_U_PRODUC
go

alter table u_productPartType
drop constraint FK_U_PRODUCM_REFERENCE_U_PRODUCP
go

alter table u_productPic
drop constraint FK_U_PRODUC_REFERENCE_U_PRODUCP
go

alter table u_productVenditionLog
drop constraint FK_U_PRODUC_REFERENCE_U_ORDER
go

alter table u_productVenditionLog
drop constraint FK_U_PRODUC_REFERENCE_U_PRODUCVL
go

alter table u_shoppingCar
drop constraint FK_U_SHOPPI_REFERENCE_U_PRODUC
go

alter table u_shoppingCar
drop constraint FK_U_SHOPPI_REFERENCE_U_USER
go

alter table u_user
drop constraint FK_U_USER_REFERENCE_U_USERTY
go

if exists (select 1
from sysobjects
where id = object_id('u_brand')
and type = 'U')
drop table u_brand
go

if exists (select 1
from sysobjects
where id = object_id('u_factory')
and type = 'U')
drop table u_factory
go

if exists (select 1
from sysobjects
where id = object_id('u_order')
and type = 'U')
drop table u_order
go

if exists (select 1
from sysobjects
where id = object_id('u_payMode')
and type = 'U')
drop table u_payMode
go

if exists (select 1
from sysobjects
where id = object_id('u_product')
and type = 'U')
drop table u_product
go

if exists (select 1
from sysobjects
where id = object_id('u_productMainType')
and type = 'U')
drop table u_productMainType
go

if exists (select 1
from sysobjects
where id = object_id('u_productPartType')
and type = 'U')
drop table u_productPartType
go

if exists (select 1
from sysobjects
where id = object_id('u_productPic')
and type = 'U')
drop table u_productPic
go

if exists (select 1
from sysobjects
where id = object_id('u_productVenditionLog')
and type = 'U')
drop table u_productVenditionLog
go

if exists (select 1
from sysobjects
where id = object_id('u_shoppingCar')
and type = 'U')
drop table u_shoppingCar
go

if exists (select 1
from sysobjects
where id = object_id('u_transportation')
and type = 'U')
drop table u_transportation
go

if exists (select 1
from sysobjects
where id = object_id('u_user')
and type = 'U')
drop table u_user
go

if exists (select 1
from sysobjects
where id = object_id('u_userType')
and type = 'U')
drop table u_userType
go



...全文
411 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
hyj_828 2006-01-09
  • 打赏
  • 举报
回复
表的關係建立有問題.
bidisty 2006-01-07
  • 打赏
  • 举报
回复
执行两次,主要是关联表的时候,还没有生成过表,连续执行两次,第一次生成表,第二次关联表.
lalafeng 2006-01-05
  • 打赏
  • 举报
回复
救命啊
lalafeng 2006-01-03
  • 打赏
  • 举报
回复
..........盗版?????

老大 国际玩笑吧~~ 我是盗版 但是也不至于倒出错误的SQL吧!~~ 晕~~

好郁闷哦
  • 打赏
  • 举报
回复
我用9.5的时候,出现了,设计的表,生成sdql脚本的时候,少了一个表,
yanlixin4csdn 2006-01-03
  • 打赏
  • 举报
回复
这种情况应该是你以前有这几个表,并且这几个表和其它的表有关系.但后来你又删除了.但关系还在就会这样.你试试在pd 中把哪几个关系显示删除试试.




///*************************///
这两年来慢慢习惯了光说不练
///*************************///

SonicChen 2006-01-03
  • 打赏
  • 举报
回复
你用的是盗版PD 11么?好象是软件问题:)
我导出到mysql碰到XX种低级错误。
lalafeng 2006-01-02
  • 打赏
  • 举报
回复
............
keebing2 2006-01-02
  • 打赏
  • 举报
回复
执行二次看看,第一次可能是因为表没有被建立,第一次有错误,现执行一次试试。
lalafeng 2006-01-02
  • 打赏
  • 举报
回复
TEST2 里当然没有'u_user'啦!!~~ 因为我是在PD中设计的 希望能够用SQL脚本直接生成那些表啊

附:TEST2 是我新建立的库啊


为什么会有

alter table u_order
drop constraint FK_U_ORDER_REFERENCE_U_USER
go

alter table u_order
drop constraint FK_U_ORDER_REFERENCE_U_PAYMOD
go

alter table u_order
drop constraint FK_U_ORDER_REFERENCE_U_TRANSP
go
这些语句呢?????? 我的库里根本没那些表啊!!!
zbyh331 2006-01-02
  • 打赏
  • 举报
回复
无法更改表 'u_user',因为数据库 'test2' 中不存在此表。

问题已经很清楚了,查看数据库TEST2,里边没有报错误的几个表吧?
把SQL语句放到查询分析器中执行

62,067

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧