Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
Node is saved as draft in My Content >> Draft
  • Inserting data from one table to another

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 5
    Comment on it

    Inserting Data from one database table to different Database table.

    INSERT INTO DataBaseB.dbo.Table2 (column1, column2) SELECT column1, column2 from DatabaseA.dbo.Table2

    Inserting Data in same database.

    We can copy all columns from one table to another, existing table use below query:

    INSERT INTO table2 SELECT * FROM table1;

    Or we can copy only the columns we want to into another, existing table with the help of below query:

    INSERT INTO table2 (columnname(s)) SELECT columnname(s) FROM table1;

    SQL Server 2008

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: