有关查询分析器的问题?

来源:百度知道 编辑:UC知道 时间:2024/06/04 06:07:17
写了一段创建table的代码,运行成功。
想在这段代码后加几条语句,覆盖以前的table,但是提示错误这个table已经存在,如何做才能运行通?
不用增加之类的语句,只想把以前的那个覆盖了。

只有在create table 前面增加一句删除表的语句了
drop table tableName

if exists(select * from sysobject where name = '表名')
Drop Table 表名

前边加一句

if exists(select * from sysobject where name = '表名')
Drop Table 表名
加在你CREATE teble 之前

alert ^即可