Wednesday, April 25, 2012
Simple, very simple Stored Procedure
USE [Bank]
GO
/****** Object: StoredProcedure [dbo].[my_sp3] Script Date: 04/25/2012 20:11:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[my_sp3]
@name varchar(20)
as
select a.account_id, a.balance, a.[type]
from account a, customer c
where (a.customer_id = c.customer_id) and (c.first_name = @name)
____________________________________________________
You can call this procedure as below :
exec my_sp3 'Бат'