Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
dmilam
Posting Yak Master
185 Posts |
Posted - 2011-02-18 : 16:45:23
|
Or can a default value be set so that it is implied. In other words,create table #temp (AssocID int,PrevEmp bit default 0,PrevMgr bit default 0)insert #tempselect x.ID as 'AssocID'from table1 x Insert Error: Column name or number of supplied values does not match table definition. |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2011-02-18 : 16:50:01
|
| If you're providing fewer values to insert than the total number of columns, yes, you must specify which columns to insert into.Better yet, you should ALWAYS specify columns in the INSERT INTO clause. Make it a habit, and you'll never have a problem. |
 |
|
|
dmilam
Posting Yak Master
185 Posts |
Posted - 2011-02-18 : 17:14:26
|
| Good to know, thanks! |
 |
|
|
|
|
|