Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to fill in the transaction log ?

Author  Topic 

russs
Starting Member

12 Posts

Posted - 2010-12-24 : 07:58:23
Hello,

I am really new to SQL, SQL Server and all.. So sorry in advance if my question is dumb .

I want the transaction log to be full, how can I do that ?

My guess was that I create a stored procedure with a lot of updates, inserts and deletes, do you agree with me ? Is there another (simpler) way to do that ?

Thank you very much in advance

shaggy
Posting Yak Master

248 Posts

Posted - 2010-12-24 : 08:02:35
what for u need tlog to be full
Go to Top of Page

russs
Starting Member

12 Posts

Posted - 2010-12-24 : 08:04:31
quote:
Originally posted by shaggy

what for u need tlog to be full



I need this to run some tests on a product we run, thank you
Go to Top of Page

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-12-24 : 08:18:15
One way I can think of (may not be best way)

Create a table with One identity column and One char column
Example:

Create table test2
(Srno int identity,
Sval char(8000)
)

Now insert thousands of record
Something like

Insert into test2 (sval)
Select 'A' from sysobjects s
cross join sysobjects
cross join syscolumns

Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2010-12-24 : 08:42:55
Set the size of the TLOG file i.e the ldf file to a few MB's and then create a table with lot of columns and insert a few records.
Your log file will be full.

PBUH

Go to Top of Page

russs
Starting Member

12 Posts

Posted - 2010-12-24 : 08:45:00
quote:
Originally posted by pk_bohra

One way I can think of (may not be best way)

Create a table with One identity column and One char column
Example:

Create table test2
(Srno int identity,
Sval char(8000)
)

Now insert thousands of record
Something like

Insert into test2 (sval)
Select 'A' from sysobjects s
cross join sysobjects
cross join syscolumns





Thank you very much, it worked
Go to Top of Page

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-12-24 : 09:08:40
quote:
Originally posted by russs

quote:
Originally posted by pk_bohra

One way I can think of (may not be best way)

Create a table with One identity column and One char column
Example:

Create table test2
(Srno int identity,
Sval char(8000)
)

Now insert thousands of record
Something like

Insert into test2 (sval)
Select 'A' from sysobjects s
cross join sysobjects
cross join syscolumns





Thank you very much, it worked



You are welcome
Go to Top of Page
   

- Advertisement -