Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Difference between Function and Procedure-in general?

Answer Posted / s.chandrahasan

A stored procedure is like a miniture program in SQL Server.
It can be as simple as a select statement, or as complex as
a long script that adds, deletes, updates, and/or reads data
from multiple tables in a database. (Stored procedures can
also implement loops and cursors which both allow you to
work with smaller results or row by row operations on data.)

The SQL Server functions are option for doing certain
operations in SQL Server. They can not be used to update,
delete, or add records to the database. They simply return a
single value or a table value. They can only be use to
select records. However, they can be called very easily from
within standard SQL, such as:

SELECT dbo.functionname('Parameter1')

OR

SELECT Name, dbo.Functionname('Parameter1') FROM sysObjects

For simple reusable select operations, functions can simply
your code. Just be wary of using JOIN clauses in your
functions. If your function has a JOIN clause and you call
it from another select statement that returns multiple
results, that function call with JOIN those tables together
for EACH line returned in the result set. So though they can
be helpful in simpling some logic, they can also be a
performance bottleneck if they're not used properly.

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain intellisense for query editing

1021


How many types of built in functions are there in sql server 2012?

914


How to add code to the existing article (using improve article)?

1097


How to create an multi-statement table-valued function?

982


What is sql server 2000 work load governor?

1050


What is function of CUBE ?

1030


Are connections to sql server encrypted?

994


what is normalization? Explain different levels of normalization? : Sql server database administration

1301


Can you explain how long are locks retained within the repeatable_read and serializable isolation levels, during a read operation with row-level locking?

974


How to fine-tune reports?

266


How do I find information about the install locations for the various instances running on a computer?

1072


What are the extra roles available in msdb? : sql server security

1122


what is a self join? Explain it with an example? : Sql server database administration

938


What are the different type of replication in sql server?

974


what's the difference between a primary key and a unique key? : Sql server database administration

934