Results 1 to 8 of 8

Thread: Copy table without data

  1. #1
    Junior Member
    Join Date
    Mar 2008
    Answers
    2

    Copy table without data

    suppose there are two seperate accounts one account has a table, how can that table be copied without the data being copied into another account


  2. #2
    Contributing Member
    Join Date
    Jul 2007
    Answers
    42

    Re: Copy table without data

    create table table_name as select * from table_name where 1=2;


  3. #3
    Junior Member
    Join Date
    Apr 2008
    Answers
    15

    Re: Copy table without data

    select * into [New tab-name] from [old tab-name]

    hope this will helpfull.............


  4. #4
    Contributing Member
    Join Date
    Sep 2007
    Answers
    35

    Re: Copy table without data

    CREATE TABLE table_name2 as select * from table_name1 where 1=0


  5. #5
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: Copy table without data

    it is not necessary to give as 1=0 or 1=2 .

    In the where clause you can provide any condition which evalutes to false.


  6. #6
    Junior Member
    Join Date
    May 2008
    Answers
    1

    Re: Copy table without data

    we can give negative value also, for this we should have known what records that table contains.


  7. #7
    Junior Member
    Join Date
    Jan 2008
    Answers
    1

    Smile Re: Copy table without data

    Quote Originally Posted by rahul.kgupta79 View Post
    suppose there are two seperate accounts one account has a table, how can that table be copied without the data being copied into another account

    Need not worry to much for such issues .have pepsi and enjoy life


  8. #8
    Junior Member
    Join Date
    Nov 2008
    Answers
    1

    Re: Copy table without data

    Quote Originally Posted by rahul.kgupta79 View Post
    suppose there are two seperate accounts one account has a table, how can that table be copied without the data being copied into another account
    you can use "paste special" option


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact