Error when using AddBatch (read mode?)

QuertonQuerton Posts: 11
edited July 17, 2007 6:44AM in SQL Toolkit Previous Versions
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

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi Pierre,

    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).
Sign In or Register to comment.