SQL里创建proc
来源:百度知道 编辑:UC知道 时间:2024/06/15 15:28:03
create proc getgzsecid @nextid char(8) output
as
declare @tmpd int
select @tmpd=isnull(max
(convert(int,substring(func_code,7,2))),0)+1
from funcframe where func_parent='010103'
if @tmpd<10 select @nextid='010103'+'0'+convert (char(1),@tmpd)
else select @nextid='010103'+convert(char(2),@tmpd)
GO
我想问下创建存储过程不是create procdure吗?为什么这里是proc呢?可以简写?
as
declare @tmpd int
select @tmpd=isnull(max
(convert(int,substring(func_code,7,2))),0)+1
from funcframe where func_parent='010103'
if @tmpd<10 select @nextid='010103'+'0'+convert (char(1),@tmpd)
else select @nextid='010103'+convert(char(2),@tmpd)
GO
我想问下创建存储过程不是create procdure吗?为什么这里是proc呢?可以简写?
CREATE PROC[EDURE] 过程名
[@参数1 类型][=默认值][ OUTPUT],
[@参数N 类型][=默认值][ OUTPUT]
AS
SQL 语句
GO
带中括号的都是可以简写或不写的。。。
创建存储过程的时候可以简写为create proc.
可以在SQL SERVER 下测试一下,不论你写作proc还是procdure,它都作为关键字处理.
对,是这样的,在SQL语言中还有很多类似的简写,比喻:Execute…exec
好难啊