1). Improved Performance : Database can optimize the data access plan used by procedure and cache it for subsequent reuse.
2). Security : Stored proceudre can be individually secured within the database. A client can be granted permissions to execute SP without having any permission on the underlying tables.
3). Easy to maintain : easier to modify a stored procedure than it is to change a hard-coded sql statement.
4). Reduce network traffice : Sql statement can be executed in batches rather than sending multiple requests from the client
Asked In: Many Interviews |