I have an ASP (IIS 4.0) based website fronting a SQL Server 2000
database. I am trying to avoid using dynamic SQL for queries, and I am
considering prepared statements as an alternative...
All the advice I have seen strongly suggests that connection objects
should not be explicitly cached, either at the application or session
level. Therefore, I am creating a connection for each page (same
connection string), and closing it immediately after use. By my
understanding, this is utilising the MTS connection pool and is the
most resource efficient method to use.
However, I have seen a number of comments to the effect that connection
pooling and prepared statements do not mix.
For example...
"Avoid creating prepared statements or temporary stored procedures.
These create server resources attached to a specific connection.
Because you might not get the same connection from the pool the next
time you ask for one, you lose the benefit of creating them in the
first place. Worse, because the connection might reside in the pool for
a long time, it can get clogged up with the useless but expensive
server resources created by each "user" that creates them." - Rob
Macdonald
(http://msdn.microsoft.com/library/de...0/html/Rob.asp)
Is this still the case? This article was written in 2000, and I was
hoping there was now some workaround for this. Are there any SQL
Server/driver level settings that can fix or alleviate this problem.
Are there any other options besides prepared statements or stored
procedures? Thanks.