Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recordset vs. Command object.

Status
Not open for further replies.

rarubio1

Programmer
Jan 25, 2002
64
US
Hello all,
In my programs I usually use a recordset to execute a stored procedure in SQL Server. I have seen other programmers use a Command object for executing stored procedures.

I was wondering, is one method was better than the other? If so, why?

Thanks!
 
I tend to use the Connection object to execute stored procs, rather then the Command object. As far as I know, there's not a huge critical difference between the two - I just prefer the Connection object, because there are less steps to take to actually execute a proc than with the Command object. Personally, for me, less steps = less chance for error, and that's a good thing in my book.

HTH,
jp
 
To execute a stored procedure that doesn't send any data, I usually use a command object. Sometimes, if I'm feeling lazy, I will send the connection a string that executes the sp.

If I want to get results back that needn't be more than one row, I usually access them from my output parameters after executing the sp, rather than open a recordset.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top