CELKO (9/9/2012)
>> I need to create a process that looks for a table in database with date(YYYYMM) appended to it where MM can be any month of current quarter and check if there exists a table and dump that data into a table. <<This makes no sense. Rows are appended to a tables, not dates. Why are you PHYSICALLY moving data from table to table? SQL programmers use VIEWs.
He's not talking about appending rows to a table, Joe. He's talking about finding tables that have table names that are essentially identical with the only difference being that the names of the tables have had a year and month notation appended to them. This type of thing happens a lot when receiving data from 3rd party sources. If you don't have the Enterprise Edition of SQL Server, the tables are typically allowed to persist as they are named as a form of "poor man's partitioning" and are frequently assembled as a complete "entity" by using partitioned views.
--Jeff Moden
Change is inevitable... Change for the better is not.