Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SP vs Function

Author  Topic 

Hamster
Starting Member

2 Posts

Posted - 2002-05-17 : 02:53:03
What is the different between Store Procedure and User Define Function ?

I had create a Store Procedure
Example:
-----------
CREATE PROCEDURE sp_ViewAllUser_param
@UserName varchar(50)
AS
Select * from v_User
where UserName = @UserName
GO


Example for Function:
---------------------
CREATE FUNCTION UserDetail (@UserName varchar)
RETURNS Table
AS

Return(Select * from v_User
where UserName = @UserName)


Can someone tell me why I should use Function instead of Store Procedure?

Thank You !




Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-05-17 : 02:59:56
Please don't cross post
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=15994

Damian
Go to Top of Page
   

- Advertisement -