Error when using AddBatch (read mode?)
Querton
Posts: 11
Hello,
I'm using the Toolkit v5 and I've a small issue when I try to use AddBatch to the end of the execution block:
_Block = provider.GetMigrationSQL(session, true);
_Block.AddBatch(" EXEC sp_addextendedproperty 'CodeSyncRun', GETDATE, 'USER', dbo, 'table', configTable");
I got the following error :
"Not writing any more - in read mode"
I'd like to add this to the ExecutionBlock then I just use BlockSaver to make a file.
How can I do this ?
Thanks a lot
Pierre
I'm using the Toolkit v5 and I've a small issue when I try to use AddBatch to the end of the execution block:
_Block = provider.GetMigrationSQL(session, true);
_Block.AddBatch(" EXEC sp_addextendedproperty 'CodeSyncRun', GETDATE, 'USER', dbo, 'table', configTable");
I got the following error :
"Not writing any more - in read mode"
I'd like to add this to the ExecutionBlock then I just use BlockSaver to make a file.
How can I do this ?
Thanks a lot
Pierre
Comments
Unfortunately, ExecutionBlock objects aren't designed to be written to. It looks like this is manifesting itself as some sort of stream error.
The only thing I can think of is to run your SQL outside of the SQL Toolkit, using the System.Data.SqlClient namespace (SqlConnection, SqlCommand, SqlCommand.ExecuteNonQuery, etc).