Walter Chang
Walter Chang

Reputation: 11596

Does SqlCommand optimize parameterized sql statements?

I know in Java, when using PreparedStatement with parameters, some JDBC drivers will optimize the SQL queries by turning them into stored procedures so that all the subsequent calls will run faster. Does SqlCommand provide such optimization when accessing MS SQLServer?

Upvotes: 3

Views: 542

Answers (1)

user151323
user151323

Reputation:

You can call command.Prepare() to perform this optimization.

http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.prepare.aspx

Upvotes: 2

Related Questions