Hi,

I'm working with Visual Basic using SQL SERVER to manage my databases.
I have several tables in my database and I need to do a SELECT from a specific table so I must pass the name of the table as a parameter using a stored procedure:

CREATE PROCEDURE Obt_Inc_Month(@month char(5))
AS

SELECT *
FROM [@month]
GO

When I try to obtain the results fromm Visual Basic:

...
Call Data.Obt_Inc_Month("Jan02&#34

Set rsMonth = Data.rsObt_Inc_Month
...

There is an error calling the procedure Obt_Inc_Month("Jan02&#34
Error:
"Invalid object name @month"

Please, anybody knows how can I use a parameter variable as a table name to make a SELECT on it?

Thank you all.
Loli