3.6. Using Parameters

Parameters are confusing because there are so many different “standards” for them. Parameters are used mainly because of the way the query engine works (and caches) in relational databases. Consider these two queries:

select * from authors where au_fname = 'Bob'
select * from authors where au_fname = 'Fred'

When a SQL engine executes these commands, it goes through a three-step process (the absolute specifics may vary among databases):

1.
The command is parsed into a tree form, and the object names are resolved. This step catches mistakes such as spelling the keyword SELECT incorrectly or referring to a table or column that does not exist.
2.
The parsed tree form of the command is analyzed by the relational manager, ...

Get Essential ADO.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.