How to Copy an SQL Command

Copying a table in Microsoft SQL Server gives the user an easier way to create and set up a new or modified table in the same database. Manually having to re-enter full lines of code to insert another table slows down the efficiency of the data editor or programmer. The "create table" command creates a table that uses the same structure of the old table but presents the option of selecting only what is necessary for the next record.

Instructions

    • 1

      Open Microsoft SQL. Click "Start" and then click on "All Programs." Click the Microsoft SQL icon.

    • 2

      Open up a database with a table. Click the "Browse" button to search for the database that needs editing.

    • 3

      Type "CREATE TABLE (table name) SELECT * FROM (title) WHERE (column title)= (entry)" into the syntax editor. Suppose you have created a table called "Monthly_Rainfall," and under the column title "averages," you want the below-average months copied to another table.

    • 4

      Type "CREATE TABLE Monthly_Rainfall SELECT * FROM Monthly_Rainfall WHERE averages='below'". The table will now only show the monthly rainfall for below-average rainfall.

Tips & Warnings

  • Always save a copy of the previous entry in case any errors occur in the copying and editing process.

Related Searches:

References

Comments

You May Also Like

Related Ads

Featured