DBCC CHECKIDENT(Product,RESEED,0)
Where Product is my table name
Wednesday, May 26, 2010
Difference between TRUNCATE & DELETE
About TRUNCATE
--------------
Much faster than Delete.
Can't be rollback.
Can't use where clause with it.
Can't use on a linked table. (When use on a table which is linked to another table you will see this message "Cannot truncate table 'TableName' because it is being referenced by a FOREIGN KEY constraint."
After using TRUNCATE all of the memory space is released back to the server.
About Delete
--------------
Slower than TRUNCATE.
Can be rollback (as its a DML operation).
Can use where clause with it.
After using Delete Command The memory will be occupied till the user does not give ROLLBACK or COMMIT.
--------------
Much faster than Delete.
Can't be rollback.
Can't use where clause with it.
Can't use on a linked table. (When use on a table which is linked to another table you will see this message "Cannot truncate table 'TableName' because it is being referenced by a FOREIGN KEY constraint."
After using TRUNCATE all of the memory space is released back to the server.
About Delete
--------------
Slower than TRUNCATE.
Can be rollback (as its a DML operation).
Can use where clause with it.
After using Delete Command The memory will be occupied till the user does not give ROLLBACK or COMMIT.
Wednesday, May 19, 2010
Subscribe to:
Posts (Atom)