Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying table data with too many fields

Status
Not open for further replies.

nimarii

MIS
Jan 26, 2004
213
US
Hi,

I'm taking data from an Oracle db, and importing it into a "holding table". After that, I'm running a stored procedure to update/add some fields, after which I need to take that data and add it to the main data table.

The problem is that there are a few fields that I don't need to copy from the holding table. Since there are so many fields in each table, is my only alternative to do an insert statement, and list each individual field out?

i apologize if i'm being lazy, i just figured that there might be a simpler way to do this...?

 
are you looking to use SELECT * and avoid listing out the columns that you're inserting?

bite the bullet and code them

:)

you can make it easier on yourself by using

SELECT TOP 1 * FROM daTable

in Query Analyzer and then copy/paste the column names into a text editor where you can search/replace the spaces between column names into commas, and then remove the columns you don't want ...

r937.com | rudy.ca
 
ehh, you're right. i ended up using several INSERT statements, and everything seems to be working correctly.

thanks for the tip on the copy/paste :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top