The stored procedure is throwing an error
Must declare a table variable
In the stored procedure, I am getting the table name from the UI that is calling this stored procedure. I do not want to create table variable in the stored procedure. If anyone has an idea, it will be greatly appreciated. Thank you.
The stored procedure is as follows:
ALTER PROCEDURE [dbo].[usp_Rates_GET_CustomOFCLData]
@returnOrigin VARCHAR(256),
@returnDest VARCHAR(256)
AS
BEGIN
SET NOCOUNT ON;
SELECT
*,
'o' as LocationType
FROM
@returnOrigin
UNION ALL
SELECT
*,
'd' as LocationType
FROM
@returnDest
END