Friday, March 23, 2012
query performance with large tables
I am currently facing two problems: one general and one more specific.
My general issue is improving the performance of queries involving a very
large table. I know that the most efficient optimization is to create indexes
that match the type of queries I run. Are there any other solutions? Can I
gain from splitting the table into several smaller ones?
The more specific problem is related to index creation. I am trying to
create an index that makes sense, but SQL Server 2005 gives a timeout error
after less than a minute. I suppose this is due to the size of the table and
cost of clustering (I set a primary key) but I can't find in BOL how to
increase the timeout value...
Any ideas regarding any of these two questions?
If you have proper indexes you should not need to split the table. You can
partition the table but that will not help you if you still don't have
proper indexes.
Don't use the gui to create the index. Use the query Editor and issue a
CREATE INDEX statement instead. The editor defaults to 0 timeout so it will
stay connected as long as it needs to.
Andrew J. Kelly SQL MVP
"Ken Abe" <KenAbe@.discussions.microsoft.com> wrote in message
news:2A0250DC-54ED-4FDC-A377-3D5F72BFEB1F@.microsoft.com...
> Hi,
> I am currently facing two problems: one general and one more specific.
> My general issue is improving the performance of queries involving a very
> large table. I know that the most efficient optimization is to create
> indexes
> that match the type of queries I run. Are there any other solutions? Can I
> gain from splitting the table into several smaller ones?
> The more specific problem is related to index creation. I am trying to
> create an index that makes sense, but SQL Server 2005 gives a timeout
> error
> after less than a minute. I suppose this is due to the size of the table
> and
> cost of clustering (I set a primary key) but I can't find in BOL how to
> increase the timeout value...
> Any ideas regarding any of these two questions?
>
query performance with large tables
I am currently facing two problems: one general and one more specific.
My general issue is improving the performance of queries involving a very
large table. I know that the most efficient optimization is to create indexe
s
that match the type of queries I run. Are there any other solutions? Can I
gain from splitting the table into several smaller ones?
The more specific problem is related to index creation. I am trying to
create an index that makes sense, but SQL Server 2005 gives a timeout error
after less than a minute. I suppose this is due to the size of the table and
cost of clustering (I set a primary key) but I can't find in BOL how to
increase the timeout value...
Any ideas regarding any of these two questions?If you have proper indexes you should not need to split the table. You can
partition the table but that will not help you if you still don't have
proper indexes.
Don't use the gui to create the index. Use the query Editor and issue a
CREATE INDEX statement instead. The editor defaults to 0 timeout so it will
stay connected as long as it needs to.
Andrew J. Kelly SQL MVP
"Ken Abe" <KenAbe@.discussions.microsoft.com> wrote in message
news:2A0250DC-54ED-4FDC-A377-3D5F72BFEB1F@.microsoft.com...
> Hi,
> I am currently facing two problems: one general and one more specific.
> My general issue is improving the performance of queries involving a very
> large table. I know that the most efficient optimization is to create
> indexes
> that match the type of queries I run. Are there any other solutions? Can I
> gain from splitting the table into several smaller ones?
> The more specific problem is related to index creation. I am trying to
> create an index that makes sense, but SQL Server 2005 gives a timeout
> error
> after less than a minute. I suppose this is due to the size of the table
> and
> cost of clustering (I set a primary key) but I can't find in BOL how to
> increase the timeout value...
> Any ideas regarding any of these two questions?
>sql
query performance with large tables
I am currently facing two problems: one general and one more specific.
My general issue is improving the performance of queries involving a very
large table. I know that the most efficient optimization is to create indexes
that match the type of queries I run. Are there any other solutions? Can I
gain from splitting the table into several smaller ones?
The more specific problem is related to index creation. I am trying to
create an index that makes sense, but SQL Server 2005 gives a timeout error
after less than a minute. I suppose this is due to the size of the table and
cost of clustering (I set a primary key) but I can't find in BOL how to
increase the timeout value...
Any ideas regarding any of these two questions?If you have proper indexes you should not need to split the table. You can
partition the table but that will not help you if you still don't have
proper indexes.
Don't use the gui to create the index. Use the query Editor and issue a
CREATE INDEX statement instead. The editor defaults to 0 timeout so it will
stay connected as long as it needs to.
Andrew J. Kelly SQL MVP
"Ken Abe" <KenAbe@.discussions.microsoft.com> wrote in message
news:2A0250DC-54ED-4FDC-A377-3D5F72BFEB1F@.microsoft.com...
> Hi,
> I am currently facing two problems: one general and one more specific.
> My general issue is improving the performance of queries involving a very
> large table. I know that the most efficient optimization is to create
> indexes
> that match the type of queries I run. Are there any other solutions? Can I
> gain from splitting the table into several smaller ones?
> The more specific problem is related to index creation. I am trying to
> create an index that makes sense, but SQL Server 2005 gives a timeout
> error
> after less than a minute. I suppose this is due to the size of the table
> and
> cost of clustering (I set a primary key) but I can't find in BOL how to
> increase the timeout value...
> Any ideas regarding any of these two questions?
>
Wednesday, March 21, 2012
Query performance difference between Sql Server 2005 and 2000
Hi,
I'm having an issue with a query I'm running on Sql Server 2005. It's a semi-complex query involving an in-line table function and several left outer joins which are joined on to the results of the function call. Two of the left outer joins are then qualified in a where clause of the form where table.Col is not null; the idea is that the final result set contains data that has no match in those two tables.
The problem revolves around a where clause in the function and the last left outer join (ie, one of the ones qualified with where not null). When I alter the where clause of the function to further restrict the result set the function returns, the query times shoots up from 1 second to roughly 2-3 minutes. Note that the time the function takes to complete is not affected. The difference in time is purely down to what the query does with the results the function provides. Also note that the change to the where clause provides a subset of the original data; it does not add any more data (it actually restricts the original resultset by roughly 1000 rows).
I can bring the query speed back down again by removing the last left outer join - this join takes one of the columns from the function, and joins it to a small table - 924 rows. So it appears that this particular join is the cause of the issue, but only when using the resultset generated from the modified function query.
Now, as the thread title alludes, Sql Server 2000 and 2005 handle this differently, or appear to. When I execute this same query on a Sql 2000 machine, there's no apparent time differences, and the data that is returned is as expected. Does anyone have any suggestions as to what might be causing this and how I can fix it? I could simply return the larger resultset and use managed code to filter out the rows I don't want; however, I would like to get to the bottom of this, especially if it's going to effect future queries.
Cheers,
Chris
Chris,
You may find Umachandar's response in this thread informative.
|||Hi Arnie,
Thanks for your reply. I'd already tried most of the things Umachandar suggests, and the performance for each query remains fairly consistent.
Thanks anyway, though.
Chris
|||
Chris,
Have you tried to compare the SQL Server 2000 and the SQL Server 2005 execution plans?
Given that the performance difference is so dramatic (1s --> 2-3min) I would expect to see some differences in the use of indices or join types. If you know what those are,you could influence the plan choice using a hint or we could look into why plan choice is different in SQL 2005. Please make sure that you are using the same database and same set of parameter values when you do this experiment.
Regards,
Leo
|||
Hi Leo,
I have not yet compared plans on the two servers. My main interest was on why the results varied so dramatically when just using sql server 2005 and adding a more stringent filter in the where clause, so I focussed on the difference between these plans (and to be honest they actually made very little sense to me!). I will try to rerun the queries and summarise the difference in plans, and if you could cast an eye over it I'd be very grateful.
Cheers,
Chris
Monday, March 12, 2012
Query over Linked Server timing out
linked server. I'm really at a loss as to what the problem could be.
This is happening with multiple views. Here's the code for one of them:
CREATE VIEW dbo.vwStates
AS
SELECT Code, Name, CountryTerritoryCode
FROM BSTBETA.ProdDB.dbo.StateProvince StateProvince_1
The name of the linked server is BSTBETA. I am able to query the view
in Enterprise Manager and Query Analyer, with no issues, and it takes
less than a second to run. The SQL I run to test this view is simply:
select * from vwStates
Howerver, when trying to query the view from an ASP.Net web application
(using the same username/password I used in Query Analyzer with the
same simple query given above), this exception is thrown:
Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection)
at
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj)
at
System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject
stateObj, UInt32 error)
at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult
asyncResult, TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParserStateObject.ReadPacket(Int32
bytesExpected)
at System.Data.SqlClient.TdsParserStateObject.ReadBuffer()
at System.Data.SqlClient.TdsParserStateObject.ReadByte()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream,
BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader
ds, RunBehavior runBehavior, String resetOptionsString)
at
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean
async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
behavior, String method)
at
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior
behavior)
at
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior
behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String
srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable)
at Pipeline2006.DataAccess.getDataSet(String strSQL, String
strTableName) in
\\Eadev2\E\inetpub\Pipeline2006\Pipeline2006_DM\Common\Classes\DataAccess.vb:line
19
The server that runs the web server and the SQL Server which is trying
to connect to BSTBETA is running Windows 2000 and SQL Server 2000. The
web app is running ASP.Net 2.0. The BSTBETA server is running Windows
2003 with SQL Server 2000.
I'm sure there's a bunch more information that might be useful, so if
anyone's got some ideas on how to troubleshoot this issue, just let me
know what might be significant.
Please help!Hi
You don't say what the login is for the ASP connection and the QA one? Have
you configured sp_addlinkedsrvlogin? Can you use the query defined in the
view directly?
John
"moskie@.gmail.com" wrote:
> I'm having some confusing problems when making a query involving a
> linked server. I'm really at a loss as to what the problem could be.
> This is happening with multiple views. Here's the code for one of them:
> CREATE VIEW dbo.vwStates
> AS
> SELECT Code, Name, CountryTerritoryCode
> FROM BSTBETA.ProdDB.dbo.StateProvince StateProvince_1
>
> The name of the linked server is BSTBETA. I am able to query the view
> in Enterprise Manager and Query Analyer, with no issues, and it takes
> less than a second to run. The SQL I run to test this view is simply:
> select * from vwStates
> Howerver, when trying to query the view from an ASP.Net web application
> (using the same username/password I used in Query Analyzer with the
> same simple query given above), this exception is thrown:
> Timeout expired. The timeout period elapsed prior to completion of the
> operation or the server is not responding.
> at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
> exception, Boolean breakConnection)
> at
> System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
> stateObj)
> at
> System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject
> stateObj, UInt32 error)
> at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult
> asyncResult, TdsParserStateObject stateObj)
> at System.Data.SqlClient.TdsParserStateObject.ReadPacket(Int32
> bytesExpected)
> at System.Data.SqlClient.TdsParserStateObject.ReadBuffer()
> at System.Data.SqlClient.TdsParserStateObject.ReadByte()
> at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
> SqlCommand cmdHandler, SqlDataReader dataStream,
> BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
> at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
> at System.Data.SqlClient.SqlDataReader.get_MetaData()
> at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader
> ds, RunBehavior runBehavior, String resetOptionsString)
> at
> System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior
> cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean
> async)
> at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
> cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
> method, DbAsyncResult result)
> at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
> cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
> method)
> at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
> behavior, String method)
> at
> System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior
> behavior)
> at
> System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior
> behavior)
> at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
> DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String
> srcTable, IDbCommand command, CommandBehavior behavior)
> at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
> CommandBehavior behavior)
> at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
> srcTable)
> at Pipeline2006.DataAccess.getDataSet(String strSQL, String
> strTableName) in
> \\Eadev2\E\inetpub\Pipeline2006\Pipeline2006_DM\Common\Classes\DataAccess.vb:line
> 19
>
> The server that runs the web server and the SQL Server which is trying
> to connect to BSTBETA is running Windows 2000 and SQL Server 2000. The
> web app is running ASP.Net 2.0. The BSTBETA server is running Windows
> 2003 with SQL Server 2000.
> I'm sure there's a bunch more information that might be useful, so if
> anyone's got some ideas on how to troubleshoot this issue, just let me
> know what might be significant.
> Please help!
>
Query over Linked Server timing out
linked server. I'm really at a loss as to what the problem could be.
This is happening with multiple views. Here's the code for one of them:
CREATE VIEW dbo.vwStates
AS
SELECT Code, Name, CountryTerritoryCode
FROM BSTBETA.ProdDB.dbo.StateProvince StateProvince_1
The name of the linked server is BSTBETA. I am able to query the view
in Enterprise Manager and Query Analyer, with no issues, and it takes
less than a second to run. The SQL I run to test this view is simply:
select * from vwStates
Howerver, when trying to query the view from an ASP.Net web application
(using the same username/password I used in Query Analyzer with the
same simple query given above), this exception is thrown:
Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection)
at
System.Data.SqlClient.TdsParser. ThrowExceptionAndWarning(TdsParserStateO
bjec
t
stateObj)
at
System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject
stateObj, UInt32 error)
at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult
asyncResult, TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParserStateObject.ReadPacket(Int32
bytesExpected)
at System.Data.SqlClient.TdsParserStateObject.ReadBuffer()
at System.Data.SqlClient.TdsParserStateObject.ReadByte()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream,
BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader
ds, RunBehavior runBehavior, String resetOptionsString)
at
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean
async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
behavior, String method)
at
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior
behavior)
at
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBeh
avior
behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String
srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable)
at Pipeline2006.DataAccess.getDataSet(String strSQL, String
strTableName) in
\\Eadev2\E\inetpub\Pipeline2006\Pipeline
2006_DM\Common\Classes\DataAccess.vb
:line
19
The server that runs the web server and the SQL Server which is trying
to connect to BSTBETA is running Windows 2000 and SQL Server 2000. The
web app is running ASP.Net 2.0. The BSTBETA server is running Windows
2003 with SQL Server 2000.
I'm sure there's a bunch more information that might be useful, so if
anyone's got some ideas on how to troubleshoot this issue, just let me
know what might be significant.
Please help!Hi
You don't say what the login is for the ASP connection and the QA one? Have
you configured sp_addlinkedsrvlogin? Can you use the query defined in the
view directly?
John
"moskie@.gmail.com" wrote:
> I'm having some confusing problems when making a query involving a
> linked server. I'm really at a loss as to what the problem could be.
> This is happening with multiple views. Here's the code for one of them:
> CREATE VIEW dbo.vwStates
> AS
> SELECT Code, Name, CountryTerritoryCode
> FROM BSTBETA.ProdDB.dbo.StateProvince StateProvince_1
>
> The name of the linked server is BSTBETA. I am able to query the view
> in Enterprise Manager and Query Analyer, with no issues, and it takes
> less than a second to run. The SQL I run to test this view is simply:
> select * from vwStates
> Howerver, when trying to query the view from an ASP.Net web application
> (using the same username/password I used in Query Analyzer with the
> same simple query given above), this exception is thrown:
> Timeout expired. The timeout period elapsed prior to completion of the
> operation or the server is not responding.
> at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
> exception, Boolean breakConnection)
> at
> System.Data.SqlClient.TdsParser. ThrowExceptionAndWarning(TdsParserStateO
bj
ect
> stateObj)
> at
> System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObje
ct
> stateObj, UInt32 error)
> at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult
> asyncResult, TdsParserStateObject stateObj)
> at System.Data.SqlClient.TdsParserStateObject.ReadPacket(Int32
> bytesExpected)
> at System.Data.SqlClient.TdsParserStateObject.ReadBuffer()
> at System.Data.SqlClient.TdsParserStateObject.ReadByte()
> at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
> SqlCommand cmdHandler, SqlDataReader dataStream,
> BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
> at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
> at System.Data.SqlClient.SqlDataReader.get_MetaData()
> at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader
> ds, RunBehavior runBehavior, String resetOptionsString)
> at
> System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior
> cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean
> async)
> at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
> cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
> method, DbAsyncResult result)
> at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
> cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
> method)
> at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
> behavior, String method)
> at
> System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior
> behavior)
> at
> System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandB
ehavior
> behavior)
> at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
> DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String
> srcTable, IDbCommand command, CommandBehavior behavior)
> at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
> CommandBehavior behavior)
> at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
> srcTable)
> at Pipeline2006.DataAccess.getDataSet(String strSQL, String
> strTableName) in
> \\Eadev2\E\inetpub\Pipeline2006\Pipeline
2006_DM\Common\Classes\DataAccess.
vb:line
> 19
>
> The server that runs the web server and the SQL Server which is trying
> to connect to BSTBETA is running Windows 2000 and SQL Server 2000. The
> web app is running ASP.Net 2.0. The BSTBETA server is running Windows
> 2003 with SQL Server 2000.
> I'm sure there's a bunch more information that might be useful, so if
> anyone's got some ideas on how to troubleshoot this issue, just let me
> know what might be significant.
> Please help!
>|||Hi
You don't say what the login is for the ASP connection and the QA one? Have
you configured sp_addlinkedsrvlogin? Can you use the query defined in the
view directly?
John
"moskie@.gmail.com" wrote:
> I'm having some confusing problems when making a query involving a
> linked server. I'm really at a loss as to what the problem could be.
> This is happening with multiple views. Here's the code for one of them:
> CREATE VIEW dbo.vwStates
> AS
> SELECT Code, Name, CountryTerritoryCode
> FROM BSTBETA.ProdDB.dbo.StateProvince StateProvince_1
>
> The name of the linked server is BSTBETA. I am able to query the view
> in Enterprise Manager and Query Analyer, with no issues, and it takes
> less than a second to run. The SQL I run to test this view is simply:
> select * from vwStates
> Howerver, when trying to query the view from an ASP.Net web application
> (using the same username/password I used in Query Analyzer with the
> same simple query given above), this exception is thrown:
> Timeout expired. The timeout period elapsed prior to completion of the
> operation or the server is not responding.
> at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
> exception, Boolean breakConnection)
> at
> System.Data.SqlClient.TdsParser. ThrowExceptionAndWarning(TdsParserStateO
bj
ect
> stateObj)
> at
> System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObje
ct
> stateObj, UInt32 error)
> at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult
> asyncResult, TdsParserStateObject stateObj)
> at System.Data.SqlClient.TdsParserStateObject.ReadPacket(Int32
> bytesExpected)
> at System.Data.SqlClient.TdsParserStateObject.ReadBuffer()
> at System.Data.SqlClient.TdsParserStateObject.ReadByte()
> at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
> SqlCommand cmdHandler, SqlDataReader dataStream,
> BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
> at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
> at System.Data.SqlClient.SqlDataReader.get_MetaData()
> at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader
> ds, RunBehavior runBehavior, String resetOptionsString)
> at
> System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior
> cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean
> async)
> at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
> cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
> method, DbAsyncResult result)
> at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
> cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
> method)
> at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
> behavior, String method)
> at
> System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior
> behavior)
> at
> System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandB
ehavior
> behavior)
> at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
> DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String
> srcTable, IDbCommand command, CommandBehavior behavior)
> at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
> CommandBehavior behavior)
> at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
> srcTable)
> at Pipeline2006.DataAccess.getDataSet(String strSQL, String
> strTableName) in
> \\Eadev2\E\inetpub\Pipeline2006\Pipeline
2006_DM\Common\Classes\DataAccess.
vb:line
> 19
>
> The server that runs the web server and the SQL Server which is trying
> to connect to BSTBETA is running Windows 2000 and SQL Server 2000. The
> web app is running ASP.Net 2.0. The BSTBETA server is running Windows
> 2003 with SQL Server 2000.
> I'm sure there's a bunch more information that might be useful, so if
> anyone's got some ideas on how to troubleshoot this issue, just let me
> know what might be significant.
> Please help!
>