1

Possible Duplicate:
Function vs. Stored Procedure in SQL Server

I want to know what the differences between a stored procedure and a function in SQL Server are?

And where each one is used in ?

For example I have just written a stored procedure and I have finished it with

return @@Identity 

So can we say is this a function because this will return a value?

These sort of problems has made me distracted.

4
  • 1
    search on google. I did.. About 698,000 results (0.32 seconds) Commented Oct 3, 2012 at 6:40
  • Here it is.. stackoverflow.com/questions/1179758/… Commented Oct 3, 2012 at 7:00
  • Also: you should use SCOPE_IDENTITY instead of @@IDENTITY Commented Oct 3, 2012 at 7:47
  • 1
    "can we say is this a function because this will return a value?". If it begins CREATE PROCEDURE then it is a procedure. If it begins CREATE FUNCTION then it is a function. Commented Oct 3, 2012 at 8:06

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.