SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Tlog Getting full While executing update statement
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

aswindba1
Yak Posting Veteran

USA
62 Posts

Posted - 08/19/2012 :  14:23:39  Show Profile  Reply with Quote
Hi All,

Could you please assist on tlog space issues. I am trying to execute the query have update statement like
''update tblGatewayPersons SET ImportDataXML_NT = ImportDataXML_NT''

tlog space getting full in a few minutes and the query is through the follwing error
''The transaction log for database 'Perspective' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases''.

Please advise me.

Thanks
Ashwin

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 08/19/2012 :  14:26:21  Show Profile  Reply with Quote
whats the size of table? try doing it in small batches

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

aswindba1
Yak Posting Veteran

USA
62 Posts

Posted - 08/19/2012 :  14:41:21  Show Profile  Reply with Quote
Hi Vishal,

Thanks for your prompt reply, Actullay I am executing the the query by bacthes itself. But the error coming when executing that single update statement.
''update tblGatewayPersons SET ImportDataXML_NT = ImportDataXML_NT''.

Table space is

filesizeMB UsedSpaceMB UnusedSpaceMB Type DBFileName
-------------------------------------------------------------
995.00 11.81 983.19 Log Perspective_Log

9000.00 6697.25 2302.75 Data Perspective_Data

6500.00 6318.88 181.13 Data Perspective_Data2

2643.00 2117.44 525.56 Data Perspective_Data3

19138.00 15145.38 3992.63 *** Total for all files ***
Go to Top of Page

aswindba1
Yak Posting Veteran

USA
62 Posts

Posted - 08/19/2012 :  15:37:32  Show Profile  Reply with Quote
Hello, Could anybody help me out from that query.
Go to Top of Page

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 08/19/2012 :  18:42:03  Show Profile  Reply with Quote
What is that update statement intented for?It seems like it is setting a column to ITSELF. I was hoping that the query optimizer would see that and generate a trivial execution plan. Since it does not, and since there are no where clauses to limit the number of rows it will update the whole table. If it is an XML column, depending the size of the XML data, it can be resource intensive.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 08/19/2012 :  21:30:44  Show Profile  Reply with Quote
quote:
Originally posted by aswindba1

Hi Vishal,

Thanks for your prompt reply, Actullay I am executing the the query by bacthes itself. But the error coming when executing that single update statement.
''update tblGatewayPersons SET ImportDataXML_NT = ImportDataXML_NT''.

Table space is

filesizeMB UsedSpaceMB UnusedSpaceMB Type DBFileName
-------------------------------------------------------------
995.00 11.81 983.19 Log Perspective_Log

9000.00 6697.25 2302.75 Data Perspective_Data

6500.00 6318.88 181.13 Data Perspective_Data2

2643.00 2117.44 525.56 Data Perspective_Data3

19138.00 15145.38 3992.63 *** Total for all files ***


this is not batch update
the above update fires over entire table in one shot.

My suggestion was to do it in batches by iterating through a loop taking a definite amount of records and processing them each time

also i see the above update is trivial ie setting same column to itself. whats the purpose of this?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

aswindba1
Yak Posting Veteran

USA
62 Posts

Posted - 08/19/2012 :  21:44:10  Show Profile  Reply with Quote
Thanks alot sunitabeck...I got an idea of it
Thank you soo much
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000