CREATE PROCEDURE NAMES AS
NAME VARCHAR (20),
REGNO VARCHAR(100),
BEGIN
SELECT NAME=@NAME FROM STUDENTDETAIL
SELECT REGNO=@REGNO FROM STUDENTDETAIL
END
为什么不创建这个存储过程?
CREATE PROCEDURE NAMES AS
NAME VARCHAR (20),
REGNO VARCHAR(100),
BEGIN
SELECT NAME=@NAME FROM STUDENTDETAIL
SELECT REGNO=@REGNO FROM STUDENTDETAIL
END
为什么不创建这个存储过程?
你
在 SQL Server 2008 中
CREATE PROCEDURE NAMES
(
NAME VARCHAR (20),
REGNO VARCHAR(100)
)
AS
SELECT * FROM STUDENTDETAIL WHERE NAME=@NAME AND REGN=@REGNO;
GO
在 MySQL 中
mysql> delimiter //
mysql> CREATE PROCEDURE NAMES (NAME VARCHAR (20), REGNO VARCHAR(100))
-> BEGIN
-> SELECT * FROM STUDENTDETAIL WHERE NAME=@NAME AND REGN=@REGNO;
-> END//