Experts Exchange > Questions > nsure that there is enough disk space available, and that the account under which the Snapshot Agent runs has permissions to write to the snapshot folder and its subdirectories.

Its giving Msg 21331, Level 16, State 1, Procedure sp_MSreplcopyscriptfile, Line 49
Cannot copy user script file to the snapshot folder at the Distributor (copy "IF ( SELECT OBJECT_ID('tableABC') ) IS NOT NULL
BEGIN
ALTER TABLE tableABC
ADD flag_column nchar NOT NULL DEFAULT 'n'
END" "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\ReplData\2011022133011641897"). Ensure that there is enough disk space available, and that the account under which the Snapshot Agent runs has permissions to write to the snapshot folder and its subdirectories.
Msg 3609, Level 16, State 2, Line 1
The transaction ended in the trigger. The batch has been aborted.
error for me.

It looks like, you have Snapshot enabled on the given database. If you create a snapshot, then all the modifications to the base Database will also be redirected to the "Snapshot" created.
And as the message is saying. Please check if you have enough space on C: drive and also, whether the account from which the SQL Server Service is running is having permissions of read-write on the given directory.

When adding a defaulted Column to an existing table, the table is fully loaded into the temp database (copy).

I don't know how big the tableABC is and how much place you have upon your C-Disk, but there might be a small issue here. ;-)

how big is my tabel ?
run following Stored procedure (is a close calculation)

CREATE PROCEDURE GetAllTableSizesAS/* Obtains spaced used data for ALL user tables in the database*/DECLARE @TableName VARCHAR(100) --For storing values in the cursorDECLARE @TableSchema VARCHAR(100) --For storing values in the cursor--Cursor to get the name of all user tables from the sysobjects listingDECLARE tableCursor CURSORFOR select sysobjects.[name],sys.schemas.[name]from sysobjectsINNER JOIN sys.schemas ON sysobjects.uid = sys.schemas.schema_id where OBJECTPROPERTY(id, N'IsUserTable') = 1FOR READ ONLY--A procedure level temp table to store the resultsCREATE TABLE #TempTable( tableName varchar(100), numberofRows varchar(100), reservedSize varchar(50), dataSize varchar(50), indexSize varchar(50), unusedSize varchar(50))--Open the cursorOPEN tableCursor--Get the first table name from the cursorFETCH NEXT FROM tableCursor INTO @TableName, @TableSchema--Loop until the cursor was not able to fetchWHILE (@@Fetch_Status >= 0)BEGIN --Dump the results of the sp_spaceused query to the temp table declare @TableFullName varchar(201) set @TableFullName= @TableSchema + '.' + @TableNameprint @TableFullName INSERT #TempTable EXEC sp_spaceused @TableFullName --Get the next table name FETCH NEXT FROM tableCursor INTO @TableName, @TableSchemaEND--Get rid of the cursorCLOSE tableCursorDEALLOCATE tableCursor--Select all records so we can use the reultsSELECT * FROM #TempTable--Final cleanup!DROP TABLE #TempTableGO

Featured Post

A bug was filed against RDO for the installation of Keystone v3. This guide is designed to walk you through the configuration for using Keystone v3 with Packstack. You will accomplish this using various repos and the Answers file.

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…

This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.