TechSapphire Sunday, 2018-12-16, 10:41 AM
Site menu
Login form
News
Play Games
  • Deep Freeze
  • Ice Slide
  • Gyroball
  • Fat Fish
  • Bush Royal Rampage
  • Main » 2012 » September » 3 » Create Table from existing table
    9:38 PM
    Create Table from existing table
    Without Data
    Select * INTO tbem1 from tbemp where 1=2

    Why 1=2?
    Because none of the record could satisfy this condition i.e. 1=2. So no data would be copied into newly created table.

    With Data
    Select * INTO tbemp2 from tbemp

    With Condition
    Select * INTO tbemp3 from tbemp where depcod=102

    Here depcod denotes to department code.


    Category: Database | Views: 1512 | Added by: Admin | Tags: with, Structure, From, Other, Copy, Data, table, Another, existing, create | Rating: 0.0/0
    Total comments: 0
    Only registered users can add comments.
    [ Registration | Login ]
    Categories
    Programming [27]
    Tips for programming
    Security [2]
    Security Tips
    Google [1]
    Use google faster then ever you use
    Project [14]
    HTML [2]
    Electronics [0]
    Data Structure [0]
    Database [16]
    SQL SERVER
    SSRS [1]
    Sql Server Reporting Services
    Copyright MyCorp © 2018