您好,登錄后才能下訂單哦!
1.存儲過程的分類
2.創建存儲過程
--選出價格區間的商品信息 create procedure sp_goods_price @minprice float ,@maxprice float as select * from goods where price>=@minprice and price <=@maxprice go
執行存儲過程: execute sp_goods_price 200 2000
3.修改存儲過程
create procedure sp_goods_betw @minprice float =200,@maxprice float=3000 as select * from goods where price>=@minprice and price <=@maxprice go
4.刪除存儲過程
drop procedure sp_goods_price
5.查看存儲過程
sp_helptext procedureName sp_help procedureName
6.重命名存儲過程
exec sp_rename oldName newName
**局部存儲過程
create procedure #sp_goods_betw @minprice float ,@maxprice float as select * from goods where price>=@minprice and price <=@maxprice go
**全局存儲過程
create procedure ##sp_goods_betw @minprice float ,@maxprice float as select * from goods where price>=@minprice and price <=@maxprice go
**不加緩存的存儲過程
create procedure sp_goods_betw @minprice float ,@maxprice float with recompile as select * from goods where price>=@minprice and price <=@maxprice go
**加密存儲過程
create procedure sp_goods_betw @minprice float ,@maxprice float with enctyption as select * from goods where price>=@minprice and price <=@maxprice go
總結
以上所述是小編給大家介紹的Sql中存儲過程的定義、修改和刪除,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對億速云網站的支持!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。