Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedure to declare variables

Status
Not open for further replies.

ProgrammingB52

Technical User
May 7, 2003
37
0
0
US
How do I write a stored procedure to declare the following variables @Phone and @CustomerID to equal the Customer's table's fields Customer.phone and Customer.customerID?
 
Code:
Create proc somename
@Phone varchar(14),
@CustomerID int
as
select * from customer where phone = @phone and customerid = @customerid
or
Code:
Create proc somename
as
declare @Phone varchar(14),@CustomerID int
set @phone ='219 123 1234'
set @customerid = '1234'
select * from customer where phone = @phone and customerid = @customerid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top