Home > Archive > MS SQL Server > July 2005 > How to delete all rows in a table









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to delete all rows in a table
Ron

2005-07-18, 9:23 am

I am running SQL Server 2000.
I need to delete all of the rows in a table within Enterprize management.
How can I do this. All I see is how to delete the table itself.
I only want to delete the data.

Ron
Jens Süßmeyer

2005-07-18, 9:23 am

Mark the first line go to the last line with STRG+End, mark the last line
(that marks all) and press DEL.

Other option would be to swtich to SQL mode (in the SQL designer) and
manipulate the SQl Statement as Follows: Delete From SomeTable --OR Truncate
table SomeTable (which is not logged). You can also issue these commands in
the QA.

HTH, jens Suessmeyer.

"Ron" wrote:

> I am running SQL Server 2000.
> I need to delete all of the rows in a table within Enterprize management.
> How can I do this. All I see is how to delete the table itself.
> I only want to delete the data.
>
> Ron

Ron

2005-07-18, 9:23 am

Thanks

"Jens Süßmeyer" wrote:
[color=darkred]
> Mark the first line go to the last line with STRG+End, mark the last line
> (that marks all) and press DEL.
>
> Other option would be to swtich to SQL mode (in the SQL designer) and
> manipulate the SQl Statement as Follows: Delete From SomeTable --OR Truncate
> table SomeTable (which is not logged). You can also issue these commands in
> the QA.
>
> HTH, jens Suessmeyer.
>
> "Ron" wrote:
>
David Gugick

2005-07-18, 11:23 am

Ron wrote:
> I am running SQL Server 2000.
> I need to delete all of the rows in a table within Enterprize
> management. How can I do this. All I see is how to delete the table
> itself.
> I only want to delete the data.
>
> Ron


The fastest way to do this as an administrator/db owner is to truncate
the table to avoid excessive logging, unless you want the operation
logged. You can do this from Query Analyzer or any query tool by issuing
a TRUNCATE TABLE <table_name>

--
David Gugick
Quest Software
www.imceda.com
www.quest.com

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com