Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TEMPDB databse is running out of space

Status
Not open for further replies.

somaiyatushar11

Programmer
Dec 3, 2002
16
IN
From batch job when the TEMPDB..TABLE table getting updated , it is running for longer time and the TEMPDB databse is running out of space causing problem to the database. There are around 5,20,000 records in TEMPDB..TABLE.

Update statement is as follows:

UPDATE tempdb..TABLE
SET COLUMN1 = '0',
COLUMN2 = '0',
COLUMN3 = NULL,
COLUMN4 = NULL
WHERE COLUMN1 <> '0'
OR COLUMN2 <> '0'
OR COLUMN3 IS NOT NULL
OR COLUMN4 IS NOT NULL
 
Hi,
Take out the useless WHERE clause
UPDATE tempdb..TABLE
SET COLUMN1 = '0',
COLUMN2 = '0',
COLUMN3 = NULL,
COLUMN4 = NULL
 
Is it the tr log or data that is causing the problem.
If data then not a lot you can do except change what you do - but I suspect it is the tr log.
Run it as 4 separate queries - one for each field or ru it on batches of recs.

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top