Re: Bulk Insert and sp_dboption

From: Russell Fields (RussellFields_at_NoMailPlease.Com)
Date: 06/25/04


Date: Fri, 25 Jun 2004 08:45:27 -0400

If you need the data in TargetDatabase, then it seems to me that loading it
to IntermediateDatabase then copying it from IntermediateDatabase to
TargetDatabase only takes more time and resources. (Opinions from anybody
else?) And, in any case, you would likely use one of the bulk_logged
statements (SELECT INTO) to get the data between databases and all the same
issues would arise.

Note that the difference in logging for bulk_logged over full is that the
data in the bulk copy statements (Select Into, bcp, Bulk Insert, Create
Index, Writetext and Updatetext) is not logged in the transaction log.
What is logged is the allocations of space, etc, necessary for the health of
of the database.

If the logs are worrisome to you, you can:
1. Backup Transaction Log
2. Change to Bulk_Logged
3. Bulk Insert
4. Change back to Full
5. Backup Transaction Log

If you don't want to risk the loss of the bulk logged data, then keep it in
full mode and manage the transaction logs.

Russell Fields

PS If Bulk Insert causes blocking problems on your database, then that might
be a reason to stage the data elsewhere and move it in smaller chunks into
your target database.
"SKG" <sunil_godiyal@yahoo.com> wrote in message
news:#wj$cYiWEHA96@tk2msftngp13.phx.gbl...
> Thanks for the links.
> Russell i have to do bulk insert while other users are accessing database.
> Would you recommend using a different database for bulk insert and finally
> transferring info into the target database.
> This way i will load data faster with select into/bulkcopy on, without
> having to backup the log of current database.
> Thanks!!!
>
> "Russell Fields" <RussellFields@NoMailPlease.Com> wrote in message
> news:%231KrzHiWEHA.1368@TK2MSFTNGP10.phx.gbl...
> > SKG,
> >
> > Bulk Insert does light logging of the bulk inserts, but continues normal
> > logging of other operations.
> >
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad
> > _bkprst_4ku1.asp
> >
> > The granularity of recovery is no longer Point-in-Time, but is limited
to
> > the boundaries of Transaction Log Backups. An article from SQL Server
> > magazine also discusses this.
> >
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsqlmag2k/
> > html/dbRecovery.asp
> >
> > Russell Fields
> > "SKG" <sunil_godiyal@yahoo.com> wrote in message
> > news:#nm3aCiWEHA.3716@TK2MSFTNGP11.phx.gbl...
> > > Iam doing bulk insert while other users are accessing the database.
> > > Does sp_dboption turns off logging for current session or for the
> database
> > > all sessions.
> > >
> > > How can i continue logging for other users, while iam doing bulk
> insert.?
> > > TIA
> > >
> > >
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Bulk-Logged Recovery question
    ... If I take a full backup of the database and then set the transaction log to ... I then bulk insert> 1 million rows into the product portfolio ... is the TRN file the normal size because it was ...
    (microsoft.public.sqlserver.server)
  • Bulk-Logged Recovery question
    ... If I take a full backup of the database and then set the transaction log to ... I then bulk insert> 1 million rows into the product portfolio ... is the TRN file the normal size because it was ...
    (microsoft.public.sqlserver.setup)
  • Re: Bulk-Logged Recovery question
    ... The point of BULK LOGGED is that all the details are not logged in the ... transaction log so it remains relatively small. ... work the extents that were modified are also backed up to the the .TRN file ... > If I take a full backup of the database and then set the transaction log ...
    (microsoft.public.sqlserver.server)
  • Re: Bulk-Logged Recovery question
    ... The point of BULK LOGGED is that all the details are not logged in the ... transaction log so it remains relatively small. ... work the extents that were modified are also backed up to the the .TRN file ... > If I take a full backup of the database and then set the transaction log ...
    (microsoft.public.sqlserver.setup)
  • Re: Transaction log problems
    ... IF you have to shrink a database or file it ... sure that you get that database backup on tape or to another machine. ... > We are using SQL Server 2000 on Windows Server 2003 Standard Edition, ... > One of the databases has recently begun showing large growth of the> transaction log and it is causing us some problems. ...
    (microsoft.public.sqlserver.server)