Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Transactional log usage for ALTER tables

$
0
0

Hello All,

I have a requirement where there is a table with ~5 million rows and the table is replicated on read server. I will need to alter the table to add two new bit fields defaulting to zero. Which is efficient Adding two alter statements or adding two fields in a single alter statement and how can we trace the log usage for these statements. I am also adding extended properties.

ALTER TABLE dbo.Table
ADD bitField1 BIT NOT NULL CONSTRAINT DF_Table_bitField1 DEFAULT(0)
ALTER TABLE dbo.Table
ADD bitField12 BIT NOT NULL CONSTRAINT DF_Table_bitField2 DEFAULT(0)

OR
ALTER TABLE
 dbo.Table ADD bitField1 BIT NOT NULL CONSTRAINT DF_Table_bitField1 DEFAULT(0)
,bitField12 BIT NOT NULL CONSTRAINT DF_Table_bitField2 DEFAULT(0)


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>