在创建数据库表或者存储过程的时候,都需要检测是否已经存在同名对象,检测函数如下:
![ContractedBlock.gif](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
![ExpandedBlockStart.gif](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
if exists(select * from sysobjects where type = 'p' and name = 'p_name')
begin
drop procedure p_name
end
在创建数据库表或者存储过程的时候,都需要检测是否已经存在同名对象,检测函数如下:
转载于:https://www.cnblogs.com/zijinguang/archive/2009/03/17/1414407.html