Finaly got the right forum
I have created a very basic stored procedure which displays Shipping Options based on geographic location.
The unique identifier is a three character letter field called 'GeographicalCoverage'
For example bellow works fine and retrieves all records from the UK as i would expect:
SELECT * FROM [Shipping]
WHERE [GeographicalCoverage] = 'UK'
ORDER BY [ShippingCode]
However the stored proc bellow retrieves no records in query analyser. And i cant understand why when i declare @ShipLocation = UK any ideas?
CODE
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[usp_ShippingOptionsByAreaGet]
@ShipLocation char(3)
AS
SELECT * FROM [Shipping]
WHERE [GeographicalCoverage] = '@ShipLocation'
ORDER BY [ShippingCode]
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
thanks
-Gus
-Gus
I have created a very basic stored procedure which displays Shipping Options based on geographic location.
The unique identifier is a three character letter field called 'GeographicalCoverage'
For example bellow works fine and retrieves all records from the UK as i would expect:
SELECT * FROM [Shipping]
WHERE [GeographicalCoverage] = 'UK'
ORDER BY [ShippingCode]
However the stored proc bellow retrieves no records in query analyser. And i cant understand why when i declare @ShipLocation = UK any ideas?
CODE
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[usp_ShippingOptionsByAreaGet]
@ShipLocation char(3)
AS
SELECT * FROM [Shipping]
WHERE [GeographicalCoverage] = '@ShipLocation'
ORDER BY [ShippingCode]
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
thanks
-Gus
-Gus