Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Microsoft SQL Server
Environment versions
SQL Server:
SQL Server 2005
I was getting this error pretty frequently at one project I inherited.
The previous developer did something I think to be very strange...
(this is not exactly functioning code, but just to give you the idea)
SELECT field1,getcustomername(customerid) FROM mytable
getcustomername
lparameters icustomerid
select customername from customer where customerid = icustomerid
return customername
He must have been thinking about reusing code, but not about SQL Server query optimization.
SELECT ;
field1,;
nvl(customer.customername,space(50)) as customername ;
from mytable ;
left outer join customer on customer.customerid = mytable.customerid
Was significantly faster.
>Hi everybody,
>
>We have problems with our test server. It often gives us
>
>An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
>
>Stack Trace:
>
>
>[SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.]
> System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +862234
>-------------------------------------------------------------------------
>What could we do to fix the problem?
>
>Thanks a lot in advance.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only