Thursday, March 8, 2012

copy data from one table to another...

hi. i'm trying to copy data from one table to another. the table has already been created but i just want to update some of the information in it.

here is what i have:

INSERT INTO DefendantCaseBAK

SELECT * FROM DefendantCase WHERE DefendantCase.StatusID=2
when i run this query, i get this error:
The column prefix 'DefendantCaseBAK' does not match with a table name or alias name used in the query.
what am i doing wrong? i looked up some examples on the internet and i copied them exactly. thanks for your help!First I would say you need to supply the column list

Does the bak table exist already?|||yes, the table does exist.

i tried including a couple columns to insert and i still get the same error.|||This is the whole script from start to end, not just the part where the compiler says the error is? Executed in a fresh new connection?|||i closed query analyzer and opened it back up and re-executed my query and worked with no problem. what gives? oh well. at least i'm not paranoid about why it's not working.|||Is it possible that you had the wrong DB selected in QA?|||I don't think that's the case the error message was too specific about a "column prefix". I think it was thrown off by some other piece of code.

No comments:

Post a Comment