I'm the kind of guy who believes in keeping as much logic as you can inside the database server. My standard practice for data-driven websites is to never write any SQL (or LINQ, etc.) in my .NET code ...
A common SQL habit is to use SELECT * on a query, because it’s tedious to list all the columns you need. Plus, sometimes those columns may change over time, so why not just do things the easy way? But ...
I know in Oracle you can use DBA_TAB_COLUMNS (or ALL_TAB_COLUMNS). My SQL Server knowledge is very rusty, but can't you use the INFORMATION_SCHEMA.COLUMNS view?
Use SQL to quickly create a new table from existing records in Access Your email has been sent SQL lets you use one command to quickly create a new table containing a subset of records from a larger ...