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 / amit kumar sharma

Select * into newTable From oldTable where 1=2

The where condition 1=2 will never get true, so only the
column of table will appear and get copied to newTable.

If we remove the where condition table with data will copy
to newtable.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Beginning with sql server version 7 0, a new enhanced data type nchar was added what type of data is supported with this data type?

964


Why is there a performance difference between two similar queries where one uses union and the other uses union all?

985


Difference between Inner vs outer joins?

895


What is difference between drop truncate and delete?

1020


How to create indexed view?

987


What is sql server 2000 work load governor?

978


Is sql server implemented as a service or an application? : Sql server database administration

897


What is the difference between inner join and equi join?

926


What is difference between createstatement and preparedstatement?

1022


What is the fillfactor concept in indexes?

935


What is nonclustered index with included columns ?

908


Difference between connected and disconnected database in .net with sql server?

1037


How do I manually uninstall an instance of sql server 2016?

965


How to sort the query output with order by clauses in ms sql server?

984


What is the difference between coalesce() & isnull()?

1049