I have a basic stored procedure that I created that is failing with an invalid collumn name error when executed. The only problem is that the variable being passed goes into the where clause and is not a column name.
ALTER PROCEDURE [dbo].[spSearchFirstName]
EXEC('Select first, last, address, address2, city, state, zip, county, [Home Phone],
[Work Phone], [Mobile Phone],
WHERE first = ' + @FirstName
EXEC spSearchFirstName @FirstName = N'Thomas '