0
我想創建一個存儲過程,將確定如果我的customerid存在,如果它存在然後我的其他參數foundcustomer將被分配到發現,否則找不到。我不能確定如何分配發現請幫助 這裏就是我想存儲過程不確定的語法
CREATE PROCEDURE procedure4
-- Add the parameters for the stored procedure here
@FoundCustomer varchar(10) = null,
@Customerid varchar (5) = null
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
if Not(@Customerid is null)
SELECT customerid
from customers
where customerid = @Customerid
END GO
您使用的是什麼RDBMS(Oracle,SQL Server,PostgreSQL,MySQL等)? –
你想要存儲過程返回什麼?也許你真的想要一個功能,而不是一個存儲過程。 –