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 2005 Forums
 Transact-SQL (2005)
 Difference b/w function & stroed procedure

Author  Topic 

zeeshan13
Constraint Violating Yak Guru

347 Posts

Posted - 2007-03-01 : 10:37:21
Hi All,

Can some one tell me the Difference b/w function & stroed procedure.

1) What is the difference in theroy b/w function & stored procedure?
2) Where a function can or cannot be used? And where a stored procedure can or cannot be used?
3) What are the limitations and advantage of one as compare to another?

Any help with be higly appreciated.

Thanks,

Zee

nr
SQLTeam MVY

12543 Posts

Posted - 2007-03-01 : 10:46:25
Have a look in bol.
You could ask what are the simularities.

They are different objects and have different uses and attributes.
Functions need to be deterministic, can't alter data, can't use dynamic sql. SPs can



==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

DilliGrg
Starting Member

7 Posts

Posted - 2007-03-01 : 11:53:42
Seems like an interview question.

Check this link:
http://www.extremeexperts.com/SQL/Articles/UDFFunctions.aspx


Thanks,

Name
---------
Dilli Grg

(1 row(s) affected)
Go to Top of Page
   

- Advertisement -