Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

You may experience timeout issues when deploying SQL CLR objects through Visual Studio


Symptoms

When you deploy SQL CLR objects from either Visual Studio 2005 or Visual Studio 2008 to SQL Server, you may experience various errors similar to the following:
  •  Error message 1:

Error: starting database upload transaction failed.

Error: The operation could not be completed

  • Error message 2:

Deploying file: TEstAssembly.dll, Path: E:\cases\CLR.MY\TEstAssembly\TEstAssembly\obj\Debug\TEstAssembly.dll ...

Error: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

But if you deploy the same CLR objects using CREATE ASSEMBLY command in SQL Server Management Studio you do not experience any issues.

↑ Back to the top


Cause

The issue occurs when the SQL CLR objects are so large that it takes a long time to deploy them to SQL Server. The default timeout value for connections is 15 seconds and for queries is 30 seconds respectively. When deploying large assemblies, the CREATE ASSEMBLY statement that gets executed on the SQL Server backend may take more than 30 seconds to return resulting in the error described in the Symptoms section.

↑ Back to the top


Resolution

Increase the Query timeout and Connection timeout values in Visual Studio using the procedures documented below.

Changing the Query Timeout:

  1. In Visual Studio IDE, navigate to Tools -> Options ->Database Tools ->Query and View Designers
  2. You can either uncheck the option Cancel long running query or change the value of Cancel after option to a higher value.

Changing the Connection Timeout:

  1. In Visual Studio IDE, enable Server Explorer by navigating to View ->Server Explorer
  2. In the Server Explorer, right click on the connection to SQL Server where the CLR objects are being deployed and choose Modify Connection.
  3. Click on Advanced button on the Modify Connection window.
  4. In the Advanced Properties window change the Connect Timeout value under Initialization section to a higher value.

↑ Back to the top


Keywords: vkball, kb

↑ Back to the top

Article Info
Article ID : 2011805
Revision : 1
Created on : 1/8/2017
Published on : 2/4/2010
Exists online : False
Views : 104