Results 1 to 7 of 7
  1. #1
    vetabz is offline Novice
    Windows 7 64bit Access 2013 32bit
    Join Date
    Jan 2017
    Location
    Philippines
    Posts
    13

    Does INTO statement delete existing table?


    Do I have to issue a DROP TABLE before I do a SELECT-INTO combination? or can I do a SELECT-INTO knowing that it will delete the existing destination table?

    I'm doing this for backup purposes or on temporary tables.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Is this an SQL Server (or Oracle) question?
    Access doesnt have drop table, nor select into,

    empty a table with a delete query.
    append query uses INSERT INTO

  3. #3
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Quote Originally Posted by ranman256 View Post
    Access doesnt have drop table, nor select into,
    Say what? Access supports DDL queries, which is what the first is, and the second is a make table query, which Access supports.

    Seems like it would have been easy to test, but in my experience Access replaces the table.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    vetabz is offline Novice
    Windows 7 64bit Access 2013 32bit
    Join Date
    Jan 2017
    Location
    Philippines
    Posts
    13
    Hmmm... can please take a look at this sample database... basically I just want to make sure that SELECT-INTO deletes the table or the data in it prior to loading the data.

    I'm not sure what you mean by the in-availability of the functions I mentioned because it's there.

    Drop_SelectInto.zip

  5. #5
    vetabz is offline Novice
    Windows 7 64bit Access 2013 32bit
    Join Date
    Jan 2017
    Location
    Philippines
    Posts
    13
    Quote Originally Posted by pbaldy View Post
    Seems like it would have been easy to test, but in my experience Access replaces the table.
    This is my guess as well, and it seems like it after testing. I basically just wanted to confirm that it is so...

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Just tested and confirmed. Just put something different into source and run the query again.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I should have added that as a rule, I'd empty/repopulate as ranman suggested rather than make table.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 10-19-2016, 09:41 AM
  2. simple delete SQL statement not working
    By markjkubicki in forum Programming
    Replies: 9
    Last Post: 05-22-2013, 05:49 PM
  3. Delete fileds in tables by using sql statement
    By BorisGomel in forum Access
    Replies: 4
    Last Post: 11-14-2012, 04:38 PM
  4. Replies: 2
    Last Post: 01-24-2012, 02:16 PM
  5. Delete SQL statement not working properly
    By Alexandre Cote in forum Programming
    Replies: 3
    Last Post: 10-18-2010, 12:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums