在建立一个存储过程之前判断是否存在该存储过程,有就删除它然后重建的语句该如何写? 语句是:if Exists(select name from sysobjects where name = 'CreateProc' and type = 'P')没有drop 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 改为 if Exists(select name from sysobjects where name = 'CreateProc' and type = 'P') Drop Proc CreateProcIf下面要加上语句,再一起运行。单独运行一句话会提示错误。 if Exists(select name from sysobjects where name = 'CreateProc' and type = 'P') drop procedure CreateProc完整的写法应该是这样```你要找到并删除!!IF是判断!判断的结果当然要执行动作了``` if exists(select name from sysobjects where name = 'CreateProc' and type = 'P')print '1'else print 2沒問題,很正常啊 初用sql server2008碰到的小问题 问了好多人都解决不了的触发器问题! 有四个字段A,B,C,D,想找出所有A,B相同但C不同的记录 存储过程的问题~~ SQL查看包括这个字符 sqlserver2005 数据中心数据上传下载方案讨论 请教高手 一个SQL生成EXCEl的问题 在线急等:一个TSQL问题 一个很难的SQL问题 请高人帮忙1!!!! 写存储过程,遍历数据 該delete語句有幾種寫法?怎樣寫較好?
if Exists(select name from sysobjects where name = 'CreateProc' and type = 'P')
Drop Proc CreateProc
If下面要加上语句,再一起运行。单独运行一句话会提示错误。
print '1'
else
print 2
沒問題,很正常啊