Creating tables and triggers dinamically Can I automatize the creation of tables and triggers to this table ?
I need to create one table every month and this table needs a trigger...
Is It possible ?
The Relational Model of Data advocates storing data in columns of rows in tables. That is, it suggests that storing data--such as year and month--in a table's name might be a Bad Thing. In my experience, it's a Very Bad Thing.
Instead, store the year and month in a column of a row in the table. Use suitable CHECK constraints. (Don't allow storing month 13 or year 32, for example.) Or store a date, from which year and month can easily be derived; columns of type &quot;date&quot; won't allow invalid months, although you might still want to use a CHECK constraint to limit the range of valid dates. Valid dates are application-dependent.
If you're concerned about the number of rows--you probably shouldn't be--read up on indexing, indexing expressions, and partitioning.