insert into dbo.Student values(cast(rand()*100 as int)) 是正确的if exists(select * from sys.procedures where name ='pro_test')
drop procedure pro_test
go
create procedure pro_test
as
(
insert into dbo.Student values(cast(rand()*100 as int))
)
为什么会报错呢??错误信息:
消息 156,级别 15,状态 1,过程 pro_test,第 5 行
关键字 'insert' 附近有语法错误。
消息 102,级别 15,状态 1,过程 pro_test,第 6 行
')' 附近有语法错误。
drop procedure pro_test
go
create procedure pro_test
as
(
insert into dbo.Student values(cast(rand()*100 as int))
)
为什么会报错呢??错误信息:
消息 156,级别 15,状态 1,过程 pro_test,第 5 行
关键字 'insert' 附近有语法错误。
消息 102,级别 15,状态 1,过程 pro_test,第 6 行
')' 附近有语法错误。
解决方案 »
- 如何将sql里的bit类型结果转换为汉字“是”或者“否”
- 急!急!datagrid控件绑定记录最后一条丢失问题
- 请教,asp.net中,常用的第三方的界面控件有哪些?
- 痛苦的我,提出菜鸟的问题,页面间传值的问题
- 请问 如何实现 datagrid 的删除列 按下时 有 "确定是否删除" 的功能 ????? 急!!!!!!!!!!!!
- RealPlayer连续播放
- 类的释放
- 关于得到网卡mac地址的方法,不论在哪得出的都是一个MAC地址。
- 一个新手问题,如何写模板列里删除更新更新的事件?
- SQL语句怎么出错了呢???
- <a href="这里如何使用后台代码里的值"></a>
- 有两个表,t_user和t_user_article,两表有一个关联字段UserID,写一个触发器,当删除t_user中用户时,连带删除t_user_artic
drop procedure pro_test
go
create procedure pro_test
as insert into dbo.Student values(cast(rand()*100 as int))
drop procedure pro_test
go
create procedure pro_test
as
insert into dbo.Student values(cast(rand()*100 as int))
if exists(select * from sys.procedures where name ='pro_test')
drop procedure pro_test
go
create procedure pro_test(-- 如果有参数的这里可以加括号~)
as insert into dbo.Student values(cast(rand()*100 as int))