is executed, it is re-compiled (by default, it is only compiled when it is created ).Encryption: the content of the created stored procedure is encrypted.TIPS: It should be noted that if we sometimes want to find the names of all the columns in the table that contain the keyword in the database, how can we find them? You can use the following statement:Copy code
Stored Procedure 6-trigger and Stored Procedure 6
I. triggers
A trigger is a table-related named database object. This object is called when a specific event occurs on the table. It is a special
is as follows:
The Code is as follows:
Create procedure procedue_name
[@ Parameter data_type] [output]
[With] {recompile | encryption}
As
SQL _statement
Note:
Output: indicates that this parameter can be returned.
Recompile in [with] {recompile | encryption} indicates that each time this stored procedure is executed, it is re-compiled (by default, it is only c
Talking about the stored procedure in the database and talking about the stored procedure in the database
I. Differences between stored procedures and functions:
1. In general, the functions implemented by stored procedures must b
Database Stored Procedure introduction and instance, database Stored Procedure instance
I. Differences between stored procedures and functions:
1. In general, the functions implemented by stored procedures must be more complex, wh
help the stored procedure execute correctly.--category: (Stored procedures in SQL Server are divided intouser-defined stored procedures、System Stored ProceduresAndExpand Stored Proceduresthree different types)1)user-defined
to temporary tables.
One case is that the returned value of the called stored procedure is a result set based on a temporary table. When the stored procedure is executed, the temporary table will not disappear because the return
A simple instance of a stored procedure and a simple instance of a stored procedure
The content of the bank deposit table (bankMoney) is as follows:
Id
UserID
Sex
Money
001
Zhangsan
Male
30
002
Wangwu
Male
50
003
($ link );?>
Note the differences between MySQL syntax and MSSQL when writing
Abstract:SQL ServerThe parameter name must start.MySQLThe parameter name is a regular identifier.
SQL ServerMultiple declarations can be made at the same time, for example, "declare V1 [data type], V2 [data type]".MySQLOnly one statement can be declared at a time, for example, "declare V1 [data type]; declare V2 [data type]".
SQL ServerThere is no begin... end in the Stored
Usage of SQL stored procedure cursor loop and How to Use cursor to write a simple loop, stored procedure cursor
The cursor and WHILE can be used to traverse each record in your query and pass the required fields to the variable for corresponding processing.
============================
DECLARE @A1 VARCHAR(10),@A2 VARCH
number of ages plus the create procedure proc_test_cursor_update (IN avgage INT (11) begin declare num int default 0; DECLARE t int default 0; DECLARE done int default 0; DECLARE pcursor cursor for select id, age FROM person; declare continue handler for sqlstate '000000' SET done = 1; -- The cursor referenced in the FETCH statement is placed after the last row of the result table. OPEN pcursor; repeat fet
that the input variable can be output and the input variable can be changed.
It's time to test the performance of your computer's hardware.
Do you still remember the bank table of that year? That is, keep it and execute the following command:
create procedure addbank()begin declare i int default 0; set i = 5000000; while i > 0 do insert into bank (name) values (i); set i = i - 1; end while;end$call a
Q: There is a problem,I called another stored procedure b in a stored procedure a "NOTE: This stored procedure cannot be changed."A #tmp data is displayed in BHow do I use #tmp data in a
A: Using temporary tables
--Create a
, periodically rebuild the index, recompile the stored procedure.
(c) Specification for use of tempdb:
I. Try to avoid using distinct, order BY, group BY, have, join, Cumpute, because these statements will aggravate the burden of tempdb.
Ii. avoid frequent creation and deletion of temporary tables and reduce the consumption of system table resources.
Iii. i
Oracle technology _ 5 minutes will use stored procedure _ simple instances of stored procedure (including loops, conditions, addition and modification queries, parameter input, variable assignment, java calls, etc)
Example business functions:
1. query the data in PROCEDURE_TEST_A t
Oracle technology _ 5 minutes will use stored procedure _ simple example of stored procedure (including loop, condition, add and modify query, parameter input, variable assignment, java call, etc.), oracle_5
Example business functions:
1. query the data in PROCEDURE_TEST_A table
[Data Center reconstruction]-view, trigger, use of stored procedure, trigger Stored Procedure
In the data room charging system, it is very troublesome to write multiple SQL statements to query multiple tables. To facilitate code writing, code decoupling and, we reference views, triggers, and
A temporary table is a table that is built into a temporary system folder and, if used properly, can be done in a variety of ways, like a normal table, and automatically released when VFP (Visual FoxPro, the latest Visual database management system platform introduced by Microsoft) exits.You can create local and global temporary tables. Local temporary tables are
registeroutparameter method, you must not only specify the data type used for this parameter, in addition, you must specify the serial number location or name of this parameter during the stored procedure. For example, if a Stored Procedure contains a single out parameter, the ordinal value is 1. If the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.