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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I create a Stored Procedure that request a parameter?

Status
Not open for further replies.

ii128

Programmer
May 18, 2001
129
US

How can I create a Stored Procedure that request a parameter?
 
A create procedure statment with the following sintax would do request the parameter @Parameter1
CREATE PROCEDURE usp_AnySprocName @Parameter1 varchar(10)
AS
<Your Code Here>
GO AL Almeida
NT/DB Admin
&quot;May all those that come behind us, find us faithfull&quot;
 
CREATE procedure AAspEAI @xmlparam
as
declare @qry varchar(1000)
set @qry = 'select distinct a.providerkey,lastname,firstname,middlename,descr as AddressType,address1,address2,city,state,zipcode
from provider a
inner join productprovider b on a.providerkey = b.providerkey
inner join clinicproduct c on b.clinickey = c.clinickey and b.contractkey = c.contractkey and b.productcodeid = c.productcodeid
inner join clinicaddress d on c.clinicproductkey = d.clinicproductkey
inner join lookup e on locationtypeid = lookupid
where where a.providerkey = ' + @xmlparam
print @qry
exec (@qry)

is it correct.
 
V.Ramesh!

It seems correct as far as sintax goes.
What exactly is your question? AL Almeida
NT/DB Admin
&quot;May all those that come behind us, find us faithfull&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top