Sql 2005: Insert into - Combining table with static data

Posted on 2007-08-09
Last Modified: 2013-11-05
Is there a way to insert data from a table with static data..

Have table 1;
ID    value1       value2   comment   team  
have table 2:
ID  value1         value 2
1      2                  3
2      3                  4  
Would like to be able to put data from table 2 into table 1 plus enter for comment and team values like
comment = commenthere and team = teamhere..kinda thing...
Question by:TechMonster
    LVL 19

    Expert Comment

    hi, you mean like this or should every row have diff. comments?

    INSERT INTO Tabel1
    SELECT ID,value1,value2,"commenthere","teamhere"
    FROM Tabel1;
    LVL 19

    Accepted Solution

    make that

    INSERT INTO Tabel1
    SELECT ID,value1,value2,"commenthere","teamhere"
    FROM Tabel2;

    Author Comment

    Awesome...thank you very much!!!
    LVL 19

    Expert Comment

    your welcome :) glad to be of help.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
    INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now