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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difficulty with SELECT INTO 1

Status
Not open for further replies.

CapnOats

Programmer
Apr 15, 2004
35
GB
Help me obi-tek-tip-kenobi, your my only hope.

What im trying to do is make a temp table Work_Backup from Work, then remove some data from Work_Backup, clear Work entirely and then copy all the data from Work_Backup, back to Work.

Now, I can get it all to work perfectly right up until the copying back into Work.

I tried to do this using a select into, but it wants to completely overwrite the table - which removes the info about primary keys.

Is there any way to do this but only inserting the data, not overwriting the table?


Regards,
Mike
 
Hi Capn, what happened when you used an append query?

HTH, Jamie
[deejay]
 
how do you append all the data from a table tho?

i was looking at something like INSERT INTO Work SELECT * FROM Work_Backup

the syntax is not right i know, but that sort of idea - im working on another part of the db right now so i can test it

any idea if this sort of thing would work?

Regards,
Mike
 
Hi,
sorry, assumed you were in Access as that was what I was using - an Access append query just builds the insert into statement for you.

There doesn't look to be anything wrong with the syntax, goes
INSERT INTO TABLE NAME
[ (COLUMN LIST) ]
VALUES (VALUE LIST)


so
INSERT INTO work
SELECT *
FROM work_backup


should be fine...

HTH, Jamie
[deejay]
 
yeah, that work spot on - and thats my database finished!

two days early, meaning - two days extra testing!

oh the delights and joys of data entry!

thanks very much



Regards,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top