jagadeep's profileWelcome to jagadeep's s...PhotosBlogListsMore Tools Help

Blog


    February 10

    To Copy a table from one database to another or within the Database in SQL Server 2005

     
     

      >>If you have a table in a database and you would like to copy the table to another database, then use this query

           Select * into AdventureWorks.dbo.Employees_New from Nothwind.dbo.Employees

          Executing the above query will copy your table to a new database.
          Just remember that using this query will only transfer the schema and data. It does not transfer the indexes, foreign keys.

          If you want to transfer all the objects from one database to another, open Sql Server Management Studio >
          Right click on your database > All Tasks > Generate SQL Scripts. Then run these scripts against the new database.

        To Transfer both schema and data
         To copy both data and schema, use the Microsoft SQL Server Database Publishing Wizard 1.1.
         This tool works for both SQL 2000 and SQL 2005 and generates a single SQL script file which can be used to recreate
         a database (both schema and data).

         

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://jagadeeps.spaces.live.com/blog/cns!D42C7F8521DB01F!499.trak
    Weblogs that reference this entry
    • None