Alpha Video Training
Results 1 to 2 of 2

Thread: Insert into table

  1. #1
    Member wburchell's Avatar
    Real Name
    Will Burchell
    Join Date
    Jun 2010
    Posts
    82

    Default Insert into table

    Hi, I'm building an A5 web project using a SQL Server backend. I have a table I would like to update with data from a view. The view gets updated with new jobs from SAGE accounts, I would like my table to update with these new records, the column names are the same in both view and table.

    So far I have used
    Code:
    SELECT * INTO tableB FROM viewA
    to create the destination table, giving me a copy of existing records, I would like to insert new records from here on but am having a little difficulty getting the query right!

    Anyone care to flex their query muscle??? :) Many thanks.
    Take care,
    Will Burchell.

  2. #2
    Member wburchell's Avatar
    Real Name
    Will Burchell
    Join Date
    Jun 2010
    Posts
    82

    Default Re: Insert into table

    Hi again, found my own answer. For those that need to know here is the solution:

    Code:
     INSERT INTO tableB
     SELECT * FROM viewA
     WHERE NOT EXISTS (SELECT * FROM tableB where viewA.id = tableB.id)
    Take care,
    Will Burchell.

Similar Threads

  1. Insert Records Into Alpha Table via ODBC
    By chimmo in forum Alpha Five Version 7
    Replies: 3
    Last Post: 04-19-2007, 03:50 PM
  2. How can I insert a field from an other table on my form
    By Luc Pilon in forum Alpha Five Version 7
    Replies: 4
    Last Post: 10-18-2006, 10:33 PM
  3. insert field in an existing table
    By Gerald Jensen in forum Alpha Five Version 5
    Replies: 8
    Last Post: 11-10-2003, 12:06 PM
  4. Insert fields in an existing table
    By Gerald Jensen in forum Alpha Five Version 5
    Replies: 2
    Last Post: 11-09-2003, 10:32 PM
  5. Insert/delete field in table structure
    By Mike Konoff in forum Alpha Five Version 4
    Replies: 1
    Last Post: 05-24-2000, 05:11 PM

Bookmarks

Posting Permissions

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