PC Review


Reply
Thread Tools Rate Thread

Delete Table .vs Delete Data

 
 
=?Utf-8?B?c3Bhcmtlcg==?=
Guest
Posts: n/a
 
      21st Jun 2005
When working with a SQL Server 2000 Backend / Access 2000 Frontend, Is it
faster to Delete an enormous table and create a new one (via Stored
Procedure), rather than to Delete all of the data in that table and reuse it?
I have not read anything on the subject. However, I was instructed by the
gentleman that introduced me to SQL Server 2000 that Delete Table is faster
than Delete Data. Which brings me to here:
While reading through somebody's post / response string on here I came
across the following that contradicts what I had been previously told:

(BEGIN ~ Quote copied from another posting for somebody else...)

If you are adding and deleting tables, your design has some
very serious mistakes. I suspect that you have gotten a
fair way down a flawed design path and are now running into
the first of the many problems caused by that design.
I suggest that you back up and look at the bigger picture to
come up with a relational design.
-- **** MVP [MS Access]

(END~ Quote copied from another posting for somebody else...)

And the second question would be is the answer to the first question the
same when applied to local tables directly in Access itself? Thanks for any
information provided!

Take Care & God Bless ~ SPARKER ~
 
Reply With Quote
 
 
 
 
Tim Ferguson
Guest
Posts: n/a
 
      21st Jun 2005
"=?Utf-8?B?c3Bhcmtlcg==?="
<SpamFreePlease@(E-Mail Removed)@SpamFreePlease> wrote in
news:60DC1E1D-4008-43C5-9A16-(E-Mail Removed):

> When working with a SQL Server 2000 Backend / Access 2000 Frontend, Is
> it faster to Delete an enormous table and create a new one (via Stored
> Procedure), rather than to Delete all of the data in that table and
> reuse it?


You are probably better off asking this is a SQL server question: or just
asking your db administrator. Note that dropping a table means dropping
all the relationships and then recreating them afterwards; you don't have
to do this with a DELETE FROM.

> If you are adding and deleting tables, your design has some
> very serious mistakes. I suspect that you have gotten a
> fair way down a flawed design path and are now running into
> the first of the many problems caused by that design.
> I suggest that you back up and look at the bigger picture to
> come up with a relational design.


I think this is broadly true. There is obviously a case for temp tables
to buffer imported data, but such would normally be created in the TEMP
database rather than the active one. I can't think of many situations,
though, where there is a legitimate reason to scrap a working table in an
active database.

> And the second question would be is the answer to the first question
> the same when applied to local tables directly in Access itself?


Either way there is likely to be a lot of fragmentation, with the risk of
corruption. Use a temp .mdb file for temp tables; correct the design for
everything else.

Hope that helps


Tim F

 
Reply With Quote
 
John Spencer (MVP)
Guest
Posts: n/a
 
      22nd Jun 2005
As far as I know (and that ain't very far), dropping (truncating?) a table in
SQL server and repopulating it is a lot faster then deleting all the records (in
large tables). Small tables (few records) may be faster to delete the old
records and add in the new ones.

The reason is that the log file does not write the delete of each record if you
drop (truncate) the table. IF i recall correctly it writes only one record to
the activity log.

Best to ask that question in the SQL forums for a good explanation.

I would say that the quote you posted applies to Access + Jet.

My two cents (and that isn't a large amount of money).

sparker wrote:
>
> When working with a SQL Server 2000 Backend / Access 2000 Frontend, Is it
> faster to Delete an enormous table and create a new one (via Stored
> Procedure), rather than to Delete all of the data in that table and reuse it?
> I have not read anything on the subject. However, I was instructed by the
> gentleman that introduced me to SQL Server 2000 that Delete Table is faster
> than Delete Data. Which brings me to here:
> While reading through somebody's post / response string on here I came
> across the following that contradicts what I had been previously told:
>
> (BEGIN ~ Quote copied from another posting for somebody else...)
>
> If you are adding and deleting tables, your design has some
> very serious mistakes. I suspect that you have gotten a
> fair way down a flawed design path and are now running into
> the first of the many problems caused by that design.
> I suggest that you back up and look at the bigger picture to
> come up with a relational design.
> -- **** MVP [MS Access]
>
> (END~ Quote copied from another posting for somebody else...)
>
> And the second question would be is the answer to the first question the
> same when applied to local tables directly in Access itself? Thanks for any
> information provided!
>
> Take Care & God Bless ~ SPARKER ~

 
Reply With Quote
 
=?Utf-8?B?c3Bhcmtlcg==?=
Guest
Posts: n/a
 
      22nd Jun 2005
Ok Thanks.
--
~ SPARKER ~


"Tim Ferguson" wrote:

> "=?Utf-8?B?c3Bhcmtlcg==?="
> <SpamFreePlease@(E-Mail Removed)@SpamFreePlease> wrote in
> news:60DC1E1D-4008-43C5-9A16-(E-Mail Removed):
>
> > When working with a SQL Server 2000 Backend / Access 2000 Frontend, Is
> > it faster to Delete an enormous table and create a new one (via Stored
> > Procedure), rather than to Delete all of the data in that table and
> > reuse it?

>
> You are probably better off asking this is a SQL server question: or just
> asking your db administrator. Note that dropping a table means dropping
> all the relationships and then recreating them afterwards; you don't have
> to do this with a DELETE FROM.
>
> > If you are adding and deleting tables, your design has some
> > very serious mistakes. I suspect that you have gotten a
> > fair way down a flawed design path and are now running into
> > the first of the many problems caused by that design.
> > I suggest that you back up and look at the bigger picture to
> > come up with a relational design.

>
> I think this is broadly true. There is obviously a case for temp tables
> to buffer imported data, but such would normally be created in the TEMP
> database rather than the active one. I can't think of many situations,
> though, where there is a legitimate reason to scrap a working table in an
> active database.
>
> > And the second question would be is the answer to the first question
> > the same when applied to local tables directly in Access itself?

>
> Either way there is likely to be a lot of fragmentation, with the risk of
> corruption. Use a temp .mdb file for temp tables; correct the design for
> everything else.
>
> Hope that helps
>
>
> Tim F
>
>

 
Reply With Quote
 
=?Utf-8?B?c3Bhcmtlcg==?=
Guest
Posts: n/a
 
      22nd Jun 2005
Ok Thanks.
--
~ SPARKER ~


"John Spencer (MVP)" wrote:

> As far as I know (and that ain't very far), dropping (truncating?) a table in
> SQL server and repopulating it is a lot faster then deleting all the records (in
> large tables). Small tables (few records) may be faster to delete the old
> records and add in the new ones.
>
> The reason is that the log file does not write the delete of each record if you
> drop (truncate) the table. IF i recall correctly it writes only one record to
> the activity log.
>
> Best to ask that question in the SQL forums for a good explanation.
>
> I would say that the quote you posted applies to Access + Jet.
>
> My two cents (and that isn't a large amount of money).
>
> sparker wrote:
> >
> > When working with a SQL Server 2000 Backend / Access 2000 Frontend, Is it
> > faster to Delete an enormous table and create a new one (via Stored
> > Procedure), rather than to Delete all of the data in that table and reuse it?
> > I have not read anything on the subject. However, I was instructed by the
> > gentleman that introduced me to SQL Server 2000 that Delete Table is faster
> > than Delete Data. Which brings me to here:
> > While reading through somebody's post / response string on here I came
> > across the following that contradicts what I had been previously told:
> >
> > (BEGIN ~ Quote copied from another posting for somebody else...)
> >
> > If you are adding and deleting tables, your design has some
> > very serious mistakes. I suspect that you have gotten a
> > fair way down a flawed design path and are now running into
> > the first of the many problems caused by that design.
> > I suggest that you back up and look at the bigger picture to
> > come up with a relational design.
> > -- **** MVP [MS Access]
> >
> > (END~ Quote copied from another posting for somebody else...)
> >
> > And the second question would be is the answer to the first question the
> > same when applied to local tables directly in Access itself? Thanks for any
> > information provided!
> >
> > Take Care & God Bless ~ SPARKER ~

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete query unable to delete records from table. Fix how? =?Utf-8?B?TG9uZ1RvbQ==?= Microsoft Access Queries 8 15th Apr 2007 11:29 AM
Delete data from table that was in another one. eclypz Microsoft Access Queries 1 7th Jul 2006 03:38 PM
Cascading Delete...#Delete found in table...what the heck is going on! Andre Laplume via AccessMonster.com Microsoft Access Queries 6 2nd Jun 2005 06:26 PM
Delete Query - Delete records in Table 1 using parameters from Tab =?Utf-8?B?SmVu?= Microsoft Access Queries 2 21st Mar 2005 01:13 PM
Delete records from one table based on the data in another table Sam Nesbitt Microsoft Access 0 26th Nov 2003 03:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:08 PM.