Thursday, April 28, 2011

whats the difference between a stored procedure and a table valued function?

whats the difference between a stored procedure and a table valued function? they seem to serve the same functions

From stackoverflow
  • Table-valued functions can return only a single result set; SPs can return multiple result sets.

    You can subsequently query over the results of table-valued functions - but not with SPs.

    So table-valued functions are more flexible if you don't need multiple result sets.

    onedaywhen : "SPs can return multiple result sets" -- or, indeed, none i.e. they may just 'do stuff' and return a return value and/or raise warnings and/or errors.

0 comments:

Post a Comment