What is difference between stored procedure and function?
Answers were Sorted based on User's Feedback
Answer / rakesh
mojor difference is
function must return a value but a
procedure may or may not return a value
Is This Answer Correct ? | 8 Yes | 1 No |
Answer / a.suresh
1.Stored Procedure return 0 to nth value where as function
return only one value which is must.
2.we can't use the stored procedure in select select
statement where as function can be used in the select statement.
3.we can use all the dml(insert,update,delete) commands in
stored procedure where as select statement only used in
functions.
4.we can use try catch in stored procedure where as in
functions cant.
function must be used with its schema where as stored
procedure used with out schema name
ex.dbo.function name
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / g.ashok
Stored Procedure need not to return a value.
Function should return a value.
Is This Answer Correct ? | 1 Yes | 0 No |
What is difference between index seek vs. Index scan?
How to skip remaining statements in a loop block using continue statements?
What is difference between joins and subqueries?
Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?
Which tcl commands are available on the sql server?
hi to all teachers,... Friends who write in the query mode Full text Search in Sql Server have experience Who make(Convert) this Stored Procedure as a normal Full text Search, which contains and .. Is used, into Advance of the tips I have thanked all friends perfection. Email : rezaafandi@yahoo.com Create PROCEDURE Sp_student @fname varchar(50), @lname varchar(50), @tel varchar(50), @code varchar(50), @adr varchar(50), @search_operation varchar(50), @totalRowCount bigint output AS begin if @search_operation = 'and' begin SELECT f3,f4,f5,f6,f7 FROM tb_student WHERE( f5 like '%' + @fname + '%' and f4 like '%' + @lname + '%' and f6 like '%' + @tel + '%' and f7 like '%' + @code + '%' and f3 like '%' + @adr +'%' ) select @totalRowCount = @@rowcount end
How column data types are determined in a view?
How to create new tables with "create table" statements in ms sql server?
What are alternate keys?
What do you understand by a view? What does the with check option clause for a view do?
What action plan is preferred if sql server is not responding?
What are “phantom rows”?