Stored Procedures | Encapsulation SQL Server 2005 can write stored procedures in. NET languages, so in small and medium applications, it becomes a good choice to use the stored procedure encapsulation application logic.
The advantages of using stored procedures to encapsulate application logic are as follows:
1, Dba+developer Division of labor Clear. Code modularity between. Reduce database operator and programmer errors.
2. Database security; You can set the account in the connection string to access only stored procedures and not to manipulate tables. Such data integrity is also guaranteed.
3, the stored procedure is compiled, fast execution.
4, transaction level, stored procedure level transaction, Ado.net level transaction comparison. Consistency.
5. Reduce the amount of network traffic. An operation that requires several lines of Transact-SQL code can be implemented by a separate statement that executes the process code, without the need to send several lines of code across the network.
The disadvantages of using stored procedures to encapsulate application logic are as follows:
1. Poor programming language SQL (excluding SQL 2005)
2, not integrated with the programming environment (not including SQL 2005)
3. Poor portability (different databases)
4, the database server pressure is big
Like the current version of the CSDN forum, its application logic is encapsulated in stored procedures. At present a more distressed feeling is that the database server pressure too much. And the cost of buying a more High-performance database server is too high. To this end, the next generation of technical community architecture design, specialized independent of the application of the logic layer. Some adjustments are also made here in the stored procedure. The application logic is no longer encapsulated entirely with stored procedures.