Thursday, April 14, 2011

Stored procedure

What is stored procedure?
  • Basically, it is a "module" or "process" that is written in SQL statement and it sits inside database. It is executable by the database server and within the monitor/management of the database server.
Will it run faster if we move the data processing codes from the application into stored procedure?
  • Yes. It will be faster because the process is running within the database server. The application sends only one request to the database server and then wait for the response. This reduces the number of data transfer between the database server and the application.

Trigger

Reference:
http://www.mssqltips.com/tip.asp?tip=1591
http://www.mssqltips.com/tip.asp?tip=1380