Possible Duplicate:
Sanitize table/column name in Dynamic SQL in .NET? (Prevent SQL injection attacks)
I have a query like so:
"SELECT * FROM MyTable_" + myID + " WHERE variable = @variable";
The SQL Parameterization works with variables, but how do I get it to work with table names? myID is an int I get passed in and changed (can be converted to string), but how do I protect against sql injections here?
myID
just another column inMyTable
? Is this a multi-tenant application? – Otoplasty