Views and Tables

  • Is there a way to insert the contents of a view into another table without having to loop through each record in the view inserting it into the destination table?

     

    Jim

  • Do you mean SELECT?

    INSERT YourTable

    SELECT Col1, Col2, ...

    FROM YourView

     

  • and to expand on what Ken said, if the table doesn't exist yet, you can use the INTO command to create it on the fly:

    SELECT Col1, Col2, ...

    INTO MyNewTable

    FROM YourView

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thanks guys

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply