SQL Server security best practice

Security! This is the word comes in mind of every concerned person when it come...

Change the Collation Settings in MS SQL Server

This post will show you how to change the collation settings in MS SQL Server for specific database...

Resolve collation conflict

In this post I will show you how you can resolve collation conflict error...

Book: SQL Server 2008 High Availability

In this book I have tried to cover every single piece of information that might requires for installing and configuring SQL Server HA option like Clustering, Replication, Log Shipping and Database Mirroring...

Why to recompile Stored Procedure

Generally, we create views and stored procedures (proc here after) ...

Showing posts with label difference. Show all posts
Showing posts with label difference. Show all posts

2/20/2007

Difference between Stored Procedure and Function (UDF)

Functions

  • can be used with Select statement

  • Not returning output parameter but returns Table variables

  • You can join UDF

  • Can not be used to change server configuration

  • Can not be used with XML FOR clause

  • Can not have transaction within function



Stored Procedure

  • have to use EXEC or EXECUTE

  • return output parameter

  • can create table but won’t return Table Variables

  • you can not join SP

  • can be used to change server configuration

  • can be used with XML FOR Clause

  • can have transaction within SP