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

Stored Proc error 1

Status
Not open for further replies.

gus121

Technical User
May 9, 2002
298
GB
Hi i am fairly new to stored procs and get an error on the line DECLARE. Can anyone point me in the right direction?

Code:
ALTER  PROCEDURE [dbo].[usp_ShippingOptionsGet]
	@ProductsWeight int,
	@CustomerID
AS

DECLARE @ShippingArea Char(3) 

SELECT @ShippingArea = Countries.Shipping_Area FROM Customer JOIN Address ON Customer.BillingAddressID = Address.AddressID JOIN Countries ON Address.CountryCode = Countries.Country_Code WHERE Customer.CustomerID = @CustomerID


SELECT 
	* 
	
FROM 
	Shipping
WHERE
	GeographicalCover = @ShippingArea 
AND
	WeightRangeLow > @ProductWeight
UNION

SELECT 
	* 
	
FROM 
	Shipping
WHERE
	GeographicalCover = @ShippingArea 
AND
	WeightRangeLow is Null
AND
	WeightRangeHigh is Null	 

ORDER BY 
	ShippingCode

thanks



-Gus
 
Your @CustomerID does not have a data type associated with it. Is it to be an Integer or VarChar?

Thanks

J. Kusch
 
Thanks for your help i new it must be simple. In my defense i come from an ASP background and we dont declare variable types.

thanks

Angus

-Gus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top