64 bit windows server 2008, sql server 2005. 4 processors. Database is in simple recovery model- when the following batch script is run, the transaction starts to rollback at "ALTER TABLE PS_RC_CASE_AUDIT ADD Z_TMP_ALTER_1 NVARCHAR(80) NULL
" - the following are the wait types observed. We have had to roll back this transaction already a couple of time because the log file was filling up and we ran out of disk space. We added more space today, and the transaction still rolls back. Any ideas?
PAGEIOLATCH_EX 5006.53
SLEEP_BPOOL_FLUSH 931.00
LCK_M_SCH_S 466.77
IO_COMPLETION 226.16
Below is the script:
USE [DBNAME]
go
SET IMPLICIT_TRANSACTIONS ON
go
--
-- Alters for record PS_RC_CASE_AUDIT
-- RC_DESCRLONG - move to table end (LONGCHAR)
-- RSLN_SUMMARY - change
-- CASE_VISIBILITY - add
-- BO_NAME - add
-- REASON_CD - add
-- Start the Transaction
-- Data Conversion
-- Add Columns
ALTER TABLE PS_RC_CASE_AUDIT ADD CASE_VISIBILITY NVARCHAR(4) NULL
go
ALTER TABLE PS_RC_CASE_AUDIT ADD BO_NAME NVARCHAR(50) NULL
go
ALTER TABLE PS_RC_CASE_AUDIT ADD REASON_CD NVARCHAR(10) NULL
go
ALTER TABLE PS_RC_CASE_AUDIT ADD Z_TMP_ALTER_1 NVARCHAR(80) NULL
go
ALTER TABLE PS_RC_CASE_AUDIT ADD X_TMP_ALTER_1 NVARCHAR(MAX) NULL
go
UPDATE PS_RC_CASE_AUDIT SET
X_TMP_ALTER_1 = RC_DESCRLONG,
Z_TMP_ALTER_1 = RSLN_SUMMARY
go
-- Set Default Values
UPDATE PS_RC_CASE_AUDIT SET CASE_VISIBILITY = ' ', BO_NAME = ' ',
REASON_CD = ' '
go
-- Modify NULLability
ALTER TABLE PS_RC_CASE_AUDIT ALTER COLUMN Z_TMP_ALTER_1 NVARCHAR(80)
NOT NULL
go
ALTER TABLE PS_RC_CASE_AUDIT ALTER COLUMN CASE_VISIBILITY NVARCHAR(4)
NOT NULL
go
ALTER TABLE PS_RC_CASE_AUDIT ALTER COLUMN BO_NAME NVARCHAR(50) NOT NULL
go
ALTER TABLE PS_RC_CASE_AUDIT ALTER COLUMN REASON_CD NVARCHAR(10) NOT
NULL
go
-- Drop Old Columns
ALTER TABLE PS_RC_CASE_AUDIT DROP COLUMN RC_DESCRLONG
go
ALTER TABLE PS_RC_CASE_AUDIT DROP COLUMN RSLN_SUMMARY
go
-- Rename Changed Columns
sp_rename 'PS_RC_CASE_AUDIT.X_TMP_ALTER_1', RC_DESCRLONG, 'COLUMN'
go
sp_rename 'PS_RC_CASE_AUDIT.Z_TMP_ALTER_1', RSLN_SUMMARY, 'COLUMN'
go
COMMIT
go
-- Done
go
COMMIT
go