Sysrq147 Sysrq147 - 5 days ago 4
SQL Question

"Must declare the table variable"

I am trying to get this code working in Visual Basic:

In a

SqlDataSource
I have try this SQL command:

SELECT * FROM @Parameter1


I have created
Parameter1
in my ReportViewer but I get error :


Must declare the table variable


Any help?

Answer

You cannot use a parameter to specify the name of a Table or the name of fields.
Parameters could only be used to express the values in a WHERE clause for a SELECT/DELETE/UPDATE or for the values passed to an INSERT/UPDATE statement

Comments