Get the Actual object (such as a table) in SQL Server?
I want to get the actual object - not the information about it in sys.objects. It would be really great if I could get a table based on its ID, assign it to a table variable, and then use that in a query instead of having to use dynamic sql. Why, you ask? The silly database I am working with has tables with names ending in a four digit year. I want to be able to pass a parameter to get the table to query. I searched high and low for this capability so maybe it's not possible but hoping it is... Any other suggestions would be greatly appreciated.