首页 > 其他 > 详细

存储过程基本使用

时间:2016-03-12 17:19:10      阅读:224      评论:0      收藏:0      [点我收藏+]

1.基础语法

create proc | procedure pro_name
    [{@参数数据类型} [=默认值] [output],
     {@参数数据类型} [=默认值] [output],
     ....
    ]
as
  SQL_statements
GO

2.创建不带参数存储过程

if (exists (select * from sys.objects where name = ‘proc_test‘))
    drop proc proc_getProjectSalaryByMonth
go
create proc proc_test
as 
	select * from Companies
go 

exec proc_test

 3、 修改存储过程

alter proc proc_test
as
select * from test2;
go 
exec proc_test

4、 带参存储过程

 

 



存储过程基本使用

原文:http://www.cnblogs.com/jt789/p/5269300.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!