Pradeep
What command is used to create a table by copying the structure of another table?
By Pradeep in SQL Server on Aug 19 2009
  • umashankar sahu
    Dec, 2012 19

    SELECT * INTO New Table FROM Exiting table SELECT * INTO mytable from HumanResources.Employee

    • 0
  • yakoob pasha
    Jul, 2010 29

    We can use :


    SELECT Column_list INTO New_Table_Name FROM Original_Table_Name

    Ex:

    select * into customers1 from cusotmers

    Thank you

    • 0
  • Priyadarshi  Datta
    Oct, 2009 31

    CREATE TABLE As SELECT Command.

    Explanation:
    To copy only the structure the where clause of the SELECT command should have a FALSE statement.
    Ex:
    CREATE TABLE newtable as SELECT * FROM exixtingtable
    WHERE 1 = 2

    If WHERE condition is true then all the rows satisfying the condition  will be copied to the newtable.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS