>> 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.
is pronounced ree-bar and is a Modenism for R
First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair
How to post code problemsHow to post performance problemsForum FAQs