How to delete all rows with truncate table statement in ms sql server?



How to delete all rows with truncate table statement in ms sql server?..

Answer / Shobhit Kumar Gupta

The TRUNCATE TABLE statement is used to remove all records from a table. It deallocates the space occupied by the table but does not reinitialize the object identification (ObjectID) values, unlike DELETE.n`nTRUNCATE TABLE YourTableName;n`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

You have several tables, and they are joined together for querying. The tables contain both clustered indexes and non clustered indexes to optimize performance, how should you distribute the tables and their indexes onto different file groups?

1 Answers  


What is the difference between migration and upgradation in sql server?

1 Answers  


If there exist a index on the table, and we then make a view on that table (include the indexed column from base table) than why do we require indexing on view?Doesnt it create an overhead?

2 Answers  


Explain what is sql server english query?

1 Answers  


What is an example of a primary key?

1 Answers  


How do I change my passwords (database, LDAP, and so on) without causing an outage?

1 Answers   IBM,


How to end a stored procedure properly in ms sql server?

1 Answers  


What are filegroups in sql server?

1 Answers  


sql database suspect We have a sql database that is showing as suspect. How can we recover?

1 Answers  


What is ddl command?

1 Answers  


Syntax to find the used space and free space of the Data file in a database(SQL Server). Following queries didn't give the exact Used space and Free Space Information sp_spaceused;DBCC showfilestats;exec MyDbName.dbo.sp_spaceused;SP_HELPFILE Can any one tell me the query for how to find the exact used data file space and free space in a Data File?

2 Answers   Cognizant,


What are the steps you can take to avoid “deadlocks”?

1 Answers  


Categories