【SQL开源代码栏目提醒】:网学会员为广大网友收集整理了,312.sql,希望对大家有所帮助!
use db_Sql
GO
--判断tb_Score15数据表是否存在,如果存在将该数据表删掉
if exists(select * from INFORMATION_SCHEMA.TABLES
where table_name = 'tb_Score15')
drop table tb_Score15
GO
--创建成绩信息表
create table tb_Score15
(
学生编号 varchar(30),
外语成绩 float,
数学成绩 float,
语文成绩 float
)
GO
--判断存储过程pro_prc15是否存在,如果存在将它删掉
if exists(select name from sysobjects
where name='pro_cx15'and type='p')
drop proc pro_cx15 --删除存储过程
GO
--创建一个存储过程
use db_Sql
GO
create procedure pro_cx15
with recompile--在创建存储过程时在定义中指定WITH RECOMPILE选项
as
select * from tb_Score15
GO