Table Name :
RM_master
Fields :
cust_no
acct_no
acct_code
Question is, I want to make the table RM_master as a variable in the parameters in the stored procedure?
This has no syntax error but when I execute this in the query analyzer by right clicking on the stored procedure name the variable table name (RM_master) is not identified
Here is my stored procedure ;
CREATE PROCEDURE RMQUERY
@cusnumber nvarchar (255) = '' ,
@acctnumber nvarchar (255) = '' ,
@master nvarchar (255) = ''
AS
BEGIN
SET @CUSNUMBER = @CUSNUMBER
DECLARE @RMRM AS NVARCHAR (255)
SET @RMRM =n'SELECT * FROM' + @MASTER + 'WHERE ACCT_NO =' + @ACCTNUMBER
EXEC RMQUERY2
END