Hi,
I have a database with about 50 GB - most of the data in one single table
with only three fields. I need to clean up this table frequently (executing
DELETE stantements). My problem is that this locks the table so that BULK
INSERT jobs cannot execute. Also the transaction lok fills up a lot (15 GB
and more) while deleting the data.
Is there a way to delete without using the transaction log and while doing a
bulk insert?
CU,
SvenHi,
I think TRUNCATE TABLE is what you are looking for.
I'm not sure you can do anything else while truncating, but
truncate is very fast.
Check BOL for further information.
Ciao,
Cosmin.
"Sven Erik Matzen" <sven.matzen@.dontspamme.com> wrote in message
news:editI8xYDHA.1004@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I have a database with about 50 GB - most of the data in one single table
> with only three fields. I need to clean up this table frequently
(executing
> DELETE stantements). My problem is that this locks the table so that BULK
> INSERT jobs cannot execute. Also the transaction lok fills up a lot (15 GB
> and more) while deleting the data.
> Is there a way to delete without using the transaction log and while doing
a
> bulk insert?
> CU,
> Sven
>|||truncate table is a good way of cleaning out the entire
table, assuming there are no foreign key constraints
for deleting large number of rows, try doing it in small
batches, say 1000-10,000 rows at a time, adjust the row
count to keep the batch run time sufficiently short
>--Original Message--
>Hi,
>I have a database with about 50 GB - most of the data in
one single table
>with only three fields. I need to clean up this table
frequently (executing
>DELETE stantements). My problem is that this locks the
table so that BULK
>INSERT jobs cannot execute. Also the transaction lok
fills up a lot (15 GB
>and more) while deleting the data.
>Is there a way to delete without using the transaction
log and while doing a
>bulk insert?
>CU,
>Sven
>
>.
>|||The problem is that I need a where statement - this is not supported by
TRUNCATE TABLE (that's one reason, why it's so fast).
"Cosmin" <cosmin.onea@.infoworld.ro> wrote in message
news:O1NbTJyYDHA.2476@.tk2msftngp13.phx.gbl...
> Hi,
> I think TRUNCATE TABLE is what you are looking for.
> I'm not sure you can do anything else while truncating, but
> truncate is very fast.
> Check BOL for further information.
> Ciao,
> Cosmin.
> "Sven Erik Matzen" <sven.matzen@.dontspamme.com> wrote in message
> news:editI8xYDHA.1004@.TK2MSFTNGP12.phx.gbl...
> > Hi,
> >
> > I have a database with about 50 GB - most of the data in one single
table
> > with only three fields. I need to clean up this table frequently
> (executing
> > DELETE stantements). My problem is that this locks the table so that
BULK
> > INSERT jobs cannot execute. Also the transaction lok fills up a lot (15
GB
> > and more) while deleting the data.
> >
> > Is there a way to delete without using the transaction log and while
doing
> a
> > bulk insert?
> >
> > CU,
> > Sven
> >
> >
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment