Quantcast
Viewing all articles
Browse latest Browse all 8

Answer by Kristen

Why not just use Dynamic SQL if the Table Name is not known until runtime?

Using dynamic SQL executed via sp_ExecuteSQL is very efficient - provided that the WHERE clause is parametrised as far as you are able, AND the other parts of the dynamic SQL re-occur reasonably often - i.e. before the query plan cache becomes "stale"


Viewing all articles
Browse latest Browse all 8

Trending Articles