1. What is a stored procedure? What is the purpose? What are the advantages?
Stored Procedure is a set of SQL statements for specific functions. It is compiled and Stored in the database, you can run a stored procedure by specifying its name and providing parameters (if the stored procedure has parameters.
Stored procedures are used to implement frequently-used queries, business rules, and public routines used by other processes.
The stored procedure is compiled on the server when it is created, so it runs faster than a single SQL statement.
2. What happens if the database is full?
A: You can only perform read operations such as query, modification, backup, and other write operations, because logs must be recorded for any write operations. That is to say, it is basically in an unusable state.
3. Does SQL Server support row-level locks?
A: Yes. The blocking mechanism is mainly used to control concurrent operations and block interference to ensure data consistency and accuracy, row-level blocking ensures that the updated row is not modified by other users during this period. Therefore, row-level locks can ensure data consistency and improve the concurrency of data operations.
4. what can happen if the database is full?
A: see Figure 2.
5. How can I operate a table in the database and another table?
A: Put the operations that operate on multiple tables into transactions for processing.
6. How does a trigger work?
A: A trigger is executed when an event is triggered. When you perform operations such as UPDATE, INSERT, and DELETE on a table, the database will automatically execute the SQL statements defined by the trigger to ensure that the data processing must comply with the rules defined by these SQL statements.