RedGate.Shared.SQL.ExecutionBlock

I am having problem with ExecuteBlock of RedGate.Shared.SQL.ExecutionBlock. The problem is, i am trying to update a database using a snapshot but the database is close to 10GB size and its timing out. is there a way to add timeout so it doesn't timeout.

here' code i am trying
Work wrk = new Work();
wrk.BuildFromDifferences(diffs, Options.Default, true);
ExecutionBlock block = wrk.ExecutionBlock;
BlockExecutor b = new BlockExecutor();
if (NTAUTHENTICATE)
{ b.ExecuteBlock(block, DBSERVER, DBNAME, true, "", ""); }
else
{ b.ExecuteBlock(block, DBSERVER, DBNAME, false, USERID, PASSWORD); }
block.Dispose();

Thanks
Arun

Comments

  • Thanks for your post.

    I believe you can add a connection timeout value (in seconds) to the connection string. i.e.
    if (NTAUTHENTICATE) 
    { b.ExecuteBlock(block, DBSERVER +";connection timeout=300", DBNAME, true, "", ""); } 
    else 
    { b.ExecuteBlock(block, DBSERVER+";connection timeout=300", DBNAME, false, USERID, PASSWORD); } 
    block.Dispose();
    

    I hope this helps.
    Chris
  • Thank you. I will give it a try.
Sign In or Register to comment.