Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Copy table without data

This is a discussion on Copy table without data within the SQL forums, part of the Databases category; 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...

Go Back   Geeks Talk > Databases > SQL
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 03-28-2008
Junior Member
 
Join Date: Mar 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
rahul.kgupta79 is on a distinguished road
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
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-28-2008
Contributing Member
 
Join Date: Jul 2007
Posts: 43
Thanks: 1
Thanked 1 Time in 1 Post
priyasp_msit is on a distinguished road
Re: Copy table without data

create table table_name as select * from table_name where 1=2;
Reply With Quote
  #3 (permalink)  
Old 04-25-2008
Junior Member
 
Join Date: Apr 2008
Location: visakhaptnam
Posts: 18
Thanks: 2
Thanked 2 Times in 1 Post
ushalakshmi is on a distinguished road
Re: Copy table without data

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

hope this will helpfull.............
Reply With Quote
  #4 (permalink)  
Old 04-25-2008
Contributing Member
 
Join Date: Sep 2007
Location: hyderabad
Posts: 37
Thanks: 5
Thanked 4 Times in 4 Posts
ashalalaxmi2002 is on a distinguished road
Re: Copy table without data

CREATE TABLE table_name2 as select * from table_name1 where 1=0
Reply With Quote
  #5 (permalink)  
Old 04-28-2008
Moderator
 
Join Date: Jun 2007
Location: Bangalore,India
Posts: 1,853
Thanks: 9
Thanked 168 Times in 142 Posts
debasisdas has a spectacular aura aboutdebasisdas has a spectacular aura about
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.
Reply With Quote
  #6 (permalink)  
Old 05-03-2008
Junior Member
 
Join Date: May 2008
Location: india
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
majidms7 is on a distinguished road
Re: Copy table without data

we can give negative value also, for this we should have known what records that table contains.
Reply With Quote
  #7 (permalink)  
Old 05-04-2008
Junior Member
 
Join Date: Jan 2008
Location: Mumbai
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
ec0321 is on a distinguished road
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
Reply With Quote
  #8 (permalink)  
Old 11-11-2008
Junior Member
 
Join Date: Nov 2008
Location: Kanpur
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
krishna1986 is on a distinguished road
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
Reply With Quote
Reply

  Geeks Talk > Databases > SQL

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Copy data from word to excel test123test QTP 1 02-27-2008 08:06 AM
Copy Table susarlasireesha Oracle 6 11-05-2007 02:30 AM
How to insert data from one table to an empty table sahanai mishra Oracle Apps 1 08-11-2007 11:45 AM
copy the Table Structure vcyogi SQL Server 3 08-04-2007 02:43 AM
How a java table be brought to data table? dhandhan QTP 0 04-15-2007 06:14 AM


All times are GMT -4. The time now is 07:58 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved