Watch Our YouTube Channel
It is currently Mon Jan 22, 2018 10:29 am
 

All times are UTC



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Jul 22, 2016 6:09 am 
Offline

Joined: Fri Nov 13, 2015 3:56 am
Posts: 460
Both functions and stored procedures are sequence of SQL statements stored in the database for future access.

Stored Procedures:
A procedure can't be called from DML statements.
Procedures are parsed and compiled.
Procedures are mainly used to process the tasks.
Procedure doesn't return value.procedure can return more than one values using OUT parameter
They are stored in compiled format in the database where as Functions are compiled and executed run time.
A procedure is used to execute business logic.
Stored procedure returns always integer value by default zero.
Stored procedure has the security and reduces the network traffic.
It create variable table and but can't return variable table.
Print command used.
It execute Dynamic SQL.

Functions:
DML operations performs in functions.
functions always return a single value to the caller.
Functions are mainly used to compute values.
A function is used to compute a value.
It returns type could be scalar or table or table values.
It create variable table and can return variable table.
Print command cant't use.
It can't execute dynamic sql.

_________________
Learn Web Development | Latest Technology News |Motivational Quotes


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 14, 2016 5:43 am 
Offline

Joined: Wed Jul 01, 2015 11:28 am
Posts: 172
Location: Bangalore
Procedure can return zero or n values whereas function can return one value which is mandatory. Procedures can have input/output parameters for it whereas functions can have only input parameters. Procedure allows select as well as DML statement in it whereas function allows only select statement in it.

_________________
Digital Marketing Company in India| Web Design Company in India | SEO Services in India


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron