Jalpesh Vadgama
Jalpesh Vadgama

Reputation: 14236

ADO.NET Command.Prepare and SQL Server 2005

I want to use ADO.NET Prepare command will increase performance if query is repeatevely called. I know about sql server 7.0 that it will use a stored procedure to prepare command but what about SQL 2005. Can anybody help me regarding this.

Upvotes: 1

Views: 675

Answers (2)

Jon Adams
Jon Adams

Reputation: 25137

IIRC, the "Prepared" part doesn't persist across database connections, and since most applications use database connection pooling. As JohnIdol mentioned, it generally isn't worth the bother.

Upvotes: 1

JohnIdol
JohnIdol

Reputation: 50107

Command.Prepare should work with the same syntax on 2005, but you will not notice improvements in performance since starting from SQL2000 (meaning that this stands valid for 2005 as well) commands are automatically optimized by your datasource making the Prepare call on a SqlCommand redundant.

Upvotes: 1

Related Questions