Home » Topic » how to use function and stored procedure in SQL Server ?

how to use function and stored procedure in SQL Server ?

Stephen West ~ Modified: September 21st, 2015 ~ ~ 1 Minute Reading

Home Forums how to use function and stored procedure in SQL Server ?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #703 Score: 0
    Stephen West
    Moderator
    4 pts

    I’ve been learning Functions and Stored Procedure, but I don’t know why and when I should use a function or a stored procedure in SQL Server. Can some one tell me why?

    #709 Score: 0
    Andrew Jackson
    Moderator
    1 pt

    You can use a function anywhere that you can use a scalar value or a table. Functions can be used in constraints, computed columns, joins, WHERE clauses, or even in other functions. Functions are an incredibly powerful part of SQL Server. Also you can use stored procedures when want to allow modular programming, faster execution, reduce traffic and also you can use Stored procedures in security mechanism

    #772 Score: 0
    Lincoln Burrows
    Moderator
    16 pts

    Functions are computed values and cannot perform permanent environmental changes to SQL Server (i.e. no INSERT or UPDATE statements allowed).
    A Function can be used inline in SQL Statements if it returns a scalar value or can be joined upon if it returns a result set.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.