我的第一个SQL存储过程

来源:互联网 发布:淘宝联盟钱怎么提现 编辑:程序博客网 时间:2024/04/28 12:53
<script type="text/javascript"><!--google_ad_client = "pub-1654710028568330";/* 728x90, 创建于 08-5-19 */google_ad_slot = "5790075209";google_ad_width = 728;google_ad_height = 90;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script><script type="text/javascript"><!--google_ad_client = "pub-1654710028568330";/* 728x15, 创建于 08-5-19 */google_ad_slot = "1395130186";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

一创建一个表mystudent

create table mystudent(sno int  not null primary key,sname char(20),sage int )

二 创建存储过程

if exists (select name from sysobjects where name='insertMystudentProc' and type='p')drop procedure insertMystudentProcgocreate procedure insertMystudentProc@sno int ,@sname char(20),@sage intasinsert into mystudent values(@sno,@sname,@sage)go

三 执行存储过程

execute  insertMystudentProc '1','张三','20'

<script type="text/javascript"><!--google_ad_client = "pub-1654710028568330";/* 728x90, 创建于 08-5-19 */google_ad_slot = "5790075209";google_ad_width = 728;google_ad_height = 90;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script><script type="text/javascript"><!--google_ad_client = "pub-1654710028568330";/* 728x15, 创建于 08-5-19 */google_ad_slot = "1395130186";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

原创粉丝点击