[sql基础]-带有输入参数的存储过称
USE Northwind --选择操作哪个数据库
GO --执行
CREATE PROCEDURE insert_Products_1 --创建存储过程 ,所创建的存储过程的名字(insert_Products_1)
( @SupplierID_2 int, --第一个输入的参数
@CategoryID_3 int, --第二个输入的参数
@ProductName_1 nvarchar(40)='无')--第三个输入的参数 并为其赋默认值
-- 存储过程 执行内容 bebin
AS --存储过程执行的内容 根据获得的参数插入数据库一条记录
INSERT INTO Products
(ProductName,SupplierID,CategoryID)
VALUES
(@ProductName_1,@SupplierID_2,@CategoryID_3)
GO--执行创建
-- 存储过程 执行内容 end
exec insert_Products_1 1,1 --执行存储过程 并设定输入参数
posted on 2010-07-05 08:57 Master zhu 阅读(276) 评论(0) 编辑 收藏 举报