-1

I have been asked this question in the technical interview.

what is the difference between output of stored procedure and a function?

Can anybody please explain this?

user1049021
  • 257
  • 1
  • 9
  • 22
  • 2
    Also, please search stackoverflow first before posting new questions, http://stackoverflow.com/questions/1179758/function-vs-stored-procedure-in-sql-server – Bassam Mehanni Feb 11 '12 at 17:44

1 Answers1

1

A user defined function can return a strongly defined scalar or a tabular value. Basically, a function can return any data type you can assign to a T-SQL variable or a rowset.

A stored procedure does not strongly define its return type. It can have zero, one or multiple result sets which can be of scalar or rowset values.

Justin Dearing
  • 14,270
  • 22
  • 88
  • 161