Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2005
    Posts
    165

    Unanswered: 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:
    Code:
    INSERT INTO DefendantCaseBAK
    
    SELECT * FROM DefendantCase WHERE DefendantCase.StatusID=2
    when i run this query, i get this error:
    Code:
    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!

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    First I would say you need to supply the column list

    Does the bak table exist already?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Jan 2005
    Posts
    165
    yes, the table does exist.

    i tried including a couple columns to insert and i still get the same error.

  4. #4
    Join Date
    Mar 2005
    Location
    Netherlands
    Posts
    280
    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?

  5. #5
    Join Date
    Jan 2005
    Posts
    165
    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.

  6. #6
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    Is it possible that you had the wrong DB selected in QA?
    Inspiration Through Fermentation

  7. #7
    Join Date
    Mar 2005
    Location
    Netherlands
    Posts
    280
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •