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 |
Auric
Yak Posting Veteran
70 Posts |
Posted - 2005-12-16 : 09:56:59
|
Hey AllI have 3 LARGE select statements in a stored procedure, they do quite a bit of data massaging and bashing to make it fit the format that one of our partners uses. I want to insert the results from the selects into 3 tables on a linked server? How do i do that? insert into Openquery(Link,'select * from wwwtest.Tablename') Values ( select stuff here ) doesn't work?Select * from users where clue > 0 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-12-16 : 10:01:52
|
Tryinsert into Openquery(Link,'select * from wwwtest.Tablename') select_stuff_hereMadhivananFailing to plan is Planning to fail |
|
|
Auric
Yak Posting Veteran
70 Posts |
Posted - 2005-12-16 : 10:13:37
|
Insert Error: Column name or number of supplied values does not match table definition.I get that error message, I checked all the column names and they are correct, the only column I am not sending a value to is an autoincrementing ID...Select * from users where clue > 0 |
|
|
Srinika
Master Smack Fu Yak Hacker
1378 Posts |
Posted - 2005-12-16 : 11:38:28
|
Instead of asteric (*), try using the field list except the autoincrementing field in both tables.Don't use the Values keywordinsert into Openquery(Link,'select b,c,d,e from wwwtest.Tablename') select b,c,d,e from SourceTbl |
|
|
Auric
Yak Posting Veteran
70 Posts |
Posted - 2005-12-16 : 14:19:50
|
Ended up getting the queries working, in a sense that I am no longer getting an error. but It is still not inserting properly. Stupid AS400Select * from users where clue > 0 |
|
|
|
|
|
|
|