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 |
|
chriskhan2000
Aged Yak Warrior
544 Posts |
Posted - 2005-03-09 : 14:28:51
|
| I have this table that I want to do an insert all without having to define the field. Is it possible to do this?INSERT * INTO SalesWHERE ID = '012322' |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-03-09 : 14:33:35
|
what do you mean exactly?and getting all of the fields in a table isn't that hard:Declare @ColumnList varchar(1000)SELECT @ColumnList = COALESCE(@ColumnList + ', ', '') + column_name FROM INFORMATION_SCHEMA.ColumnsWHERE table_name = 'TableName'select @ColumnList Go with the flow & have fun! Else fight the flow |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2005-03-09 : 14:35:35
|
| INSERT INTO SALESSELECT * FROM SomeTable WHERE...But I don't recommend it....Brett8-) |
 |
|
|
chriskhan2000
Aged Yak Warrior
544 Posts |
Posted - 2005-03-09 : 14:50:16
|
Thanks you both. Being a newbie is quite hard, but for you gurus it's a piece of cake. hehe. |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-03-09 : 14:56:25
|
brett doesn't recomend it because your data might not get inserted into proper columns.it depends on the ordinal position of the column in a table.Go with the flow & have fun! Else fight the flow |
 |
|
|
|
|
|