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 bit datatype? : Sql server database administration

909


What is difference between sql and sql server?

989


What is the Main Difference between ACCESS and SQL SERVER?

1122


You want to generate a report that is formatted as a chart. Can you use the report wizard to create such a report?

121


What does normalization do to data?

1055


How display code or Text of Stored Procedure using Sql query in Sql Server ?

1139


What is the purpose of floor function?

1027


What is query cost in sql server?

986


Explain trigger and trigger types?

961


State the difference between union and union all?

924


What are various aggregate functions that are available?

973


What are various ways to enhance the ssrs report?

974


What is the full meaning of dml?

945


What is store procedure? How do they work? When do you use?

936


Can you please explain the difference between primary keys and foreign keys?

1099