I have a simple SQL script that I execute manually from Visual Studio. It is a data generation script so I expect it to take a couple of minutes to run. But I get the follow
Increase the Query timeout and Connection timeout values in Visual Studio using the procedures documented below. Changing the Query Timeout:
In Visual Studio IDE, navigate to Tools -> Options ->Database Tools ->Query and View Designers 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:
In Visual Studio IDE, enable Server Explorer by navigating to View ->Server Explorer In the Server Explorer, right click on the connection to SQL Server where the CLR objects are being deployed and choose Modify Connection. Click on Advanced button on the Modify Connection window. In the Advanced Properties window change the Connect Timeout value under Initialization section to a higher value.
http://support.microsoft.com/kb/2011805