简体   繁体   中英

What's equivalent to TRUNCATE TABLE in SQL Server?

I'm looking for something equivalent to TRUNCATE TABLE

How I do this using SQL Server 2005?

Thanks in advance!

t-sql for sql server 2005:

TRUNCATE TABLE schema.tablename;
GO

link: http://msdn.microsoft.com/en-us/library/ms177570%28v=SQL.90%29.aspx

AFAIK TRUNCATE TABLE works in server 2005 (just tried it to make sure) so just consider this an alternative, but still not sure why you don't want to use it.

Did you try

DELETE FROM TABLE

or

DELETE FROM TABLE WHERE 1=1 --SQL server may warn no expression in the previous one

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM