DATETIME SELECT SELECT INTO DATE PAD STRING DYNAMIC SQL CURSOR MONEY FORMAT PERCENT STORED PROCEDURE SQL SERVER AGENT JOB OPTIMIZATION WHILE LOOP OVER PARTITION BY UPDATE
 
 
SITE SEARCH SQLUSA.com VIDEOS
 
 
SQL E/BOOKS   WORLD, USA & SQL NEWS   FORMAT
SCRIPTS SQL 2005 SQL 2008 ARTICLES
How to avoid using INSERT without a column list?

It is undesirable to include insert TableX values(...) in your code or stored procedure because if a column is added or deleted, you can expect a sure bug.

With sp_help TableX you can easily get a column list. Just cut and paste it, add commas and you have the insert with the explicit column names.

You can also do this from the Object Explorer in SSMS via the Script Table option.

Related article:

SQL Server FAQ - Providing Column Names in INSERT Statements

 

Exam Prep 70-461
SQL 2016 DESIGN & PROGRAMMING
 
 
 
DATETIME SELECT SELECT INTO DATE PAD STRING DYNAMIC SQL CURSOR MONEY FORMAT PERCENT STORED PROCEDURE SQL SERVER AGENT JOB OPTIMIZATION WHILE LOOP OVER PARTITION BY UPDATE