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 are constraints in microsoft sql server?

1144


List the various tools available for performance tuning?

890


What is the purpose of grouping data in a report?

971


What is 2nf normalization form?

1144


How to connect php with different port numbers?

1090


Tell me what do you understand by a view? What does the with check option clause for a view do?

1021


What are the 3 types of schema?

1114


What are the rendering extensions of ssrs?

157


What is the default Port No on which SQL Server listens?

1127


What are the advantages of passing name-value pairs as parameters?

1168


What are advantages of ssrs or why we should use ssrs?

139


What are horizontal and vertical scaling?

172


List down some advantages of sql stored procedure?

969


Write a sql query to delete duplicate records from a table called table1

1041


How to create a simple stored procedure in ms sql server?

1035