/*==============================================================*/
/* DBMS name: Sybase SQL Anywhere 10 */
/* Created on: 2010-6-17 16:32:10 */
/*==============================================================*/
if exists(select 1 from sys.sysforeignkey where role='FK_T_SELCOU_T_SELCOUR_T_STUDEN') then
alter table t_selcour
delete foreign key FK_T_SELCOU_T_SELCOUR_T_STUDEN
end if;if exists(select 1 from sys.sysforeignkey where role='FK_T_SELCOU_T_SELCOUR_T_COURSE') then
alter table t_selcour
delete foreign key FK_T_SELCOU_T_SELCOUR_T_COURSE
end if;if exists(select 1 from sys.sysforeignkey where role='FK_T_TESCOU_T_TESCOUR_T_TEACHE') then
alter table t_tescour
delete foreign key FK_T_TESCOU_T_TESCOUR_T_TEACHE
end if;后面的略掉
*
第 5 行出现错误:
ORA-00900: 无效 SQL 语句
/* DBMS name: Sybase SQL Anywhere 10 */
/* Created on: 2010-6-17 16:32:10 */
/*==============================================================*/
if exists(select 1 from sys.sysforeignkey where role='FK_T_SELCOU_T_SELCOUR_T_STUDEN') then
alter table t_selcour
delete foreign key FK_T_SELCOU_T_SELCOUR_T_STUDEN
end if;if exists(select 1 from sys.sysforeignkey where role='FK_T_SELCOU_T_SELCOUR_T_COURSE') then
alter table t_selcour
delete foreign key FK_T_SELCOU_T_SELCOUR_T_COURSE
end if;if exists(select 1 from sys.sysforeignkey where role='FK_T_TESCOU_T_TESCOUR_T_TEACHE') then
alter table t_tescour
delete foreign key FK_T_TESCOU_T_TESCOUR_T_TEACHE
end if;后面的略掉
*
第 5 行出现错误:
ORA-00900: 无效 SQL 语句
ALTER TABLE table_name DROP CONSTRAINT constraint_name
delete foreign key FK_T_SELCOU_T_SELCOUR_T_STUDEN
--全部改为,删除约束不是那样写的
alter table t_selcour
drop constraint 约束名--把你的改成这样写
alter table t_selcour
drop constraint FK_T_SELCOU_T_SELCOUR_T_STUDEN