Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How can I create a table from another table without copying any values from the old table?

Answer Posted / mohammadali.info

CREATE TABLE new_table
AS (SELECT * FROM old_table WHERE 1=2);

For example:

CREATE TABLE suppliers
AS (SELECT * FROM companies WHERE 1=2);

This would create a new table called suppliers that included all columns from the companies table, but no data from the companies table.

Is This Answer Correct ?    7 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between functions and stored procedures?

1226


How do I uninstall sql server 2014?

985


What is the difference between lock, block and deadlock? : sql server database administration

1094


What is usually the first word in a sql query?

1176


Do you know what are the restrictions applicable while creating views? : SQL Server Architecture

1052


What is transaction server implicit?

1067


What is order of B+tree?

1155


What are distributed partitioned views?

1137


What is efficiency data?

1004


What is the name of the Database which IBM mainframe uses?

1033


Explain an automatic checkpoint

1018


How do use Having,Group by,Group function in SQL?

1789


What does the not null constraint do?

1180


Explain having clause?

1030


What is collation sensitivity?

1135