I need to retrieve some fields from a table that match a given ID
. Currently, I build a sql statement
SELECT a, b, c
FROM d
WHERE id = @id
Then execute it using the DataReader
.
I could also write a stored proc that takes the id
as parameter.
I wanted to know which is more performance friendly.
EDIT: I am using a parameterized query, edited the question to reflect that.