Dynamic SQL is the way to go but you need to consider that the dynamic SQL statements are not validated during the stored procedure compilation, they are only validated during the stored procedure execution!
↧