【SQL开源代码栏目提醒】:网学会员--在 SQL开源代码编辑为广大网友搜集整理了:实例302存储过程的重新编译.sql绩等信息,祝愿广大网友取得需要的信息,参考学习。
use db_
sql2000
GO
--判断tb_Score16数据表是否存在,如果存在将该数据表删掉
if exists(select * from INFORMATION_SCHEMA.TABLES
where table_name = 'tb_Score16')
drop table tb_Score16
GO
--创建成绩信息表
create table tb_Score16
(
学生编号 varchar(30),
外语成绩 float,
数学成绩 float,
语文成绩 float
)
GO
--判断存储过程pro_prc16是否存在,如果存在将它删掉
if exists(select name from sysobjects
where name='pro_cx16'and type='p')
drop proc pro_cx16 --删除存储过程
GO
--创建一个存储过程
use db_sql2000
GO
create procedure pro_cx16
with recompile--在创建存储过程时在定义中指定WITH RECOMPILE选项
as
select * from tb_Score16
GO