In MySQL, the basic form of creating stored procedures is as follows:
CREATE PROCEDURE sp_name ([proc_parameter[,...]])
[Characteristic ...] Routine_body
Where the Sp_name parameter is the name of the stored procedure,
1. Database Connection Table1.1, a pair of moreUse foreign keys to make constraints. Note: The data types of the foreign key columns are consistent.Commands to create foreign keys in the same wayCREATE Table Part1 (Nid int not NULL auto_increment
MySQL partition table: Logically a table, physically a collection of tables composed of multiple child tables, each of which is relatively independent,Each store their own data and index. This partition table is also called the Local partition table.
In MySQL, the basic form of creating stored procedures is as follows:
CREATE PROCEDURE sp_name ([proc_parameter[,...]])
[Characteristic ...] Routine_body
Where the Sp_name parameter is the name of the stored procedure,
SQL Server Stored ProceduresStored procedures are similar to functions that can be reused. Stored procedures are more powerful and more flexible than functions.Stored procedures can contain logical control statements and data manipulation statements,
Frog Frog recommended: How to do an efficient ASP database operating procedures
In general, we do ASP database programs are ado+access, and are using some query string plus recordset to manipulate the database, up to only the use of connection and
Test Table 1?
1 2 3 4 5 6 7 8
DROP TABLE IF EXISTS test; CREATE TABLE Test (id bigint (one) unsigned not NULL auto_increment, name varchar (m) NOT null DEF Ault ', type varchar (MB), Create_time datetime, PRIMARY KEY (ID))
Copy Code code as follows:
--ACL Tables
--The structure of the table ' Aclresources '
DROP TABLE IF EXISTS ' aclresources ';
CREATE TABLE IF not EXISTS ' aclresources ' (
' rsid ' varchar not NULL,
' Access ' int (4) not NULL default 0,
'
1 determine if the database exists
if exists (SELECT * from sys.databases WHERE name = ' database name ')Drop DB [Database name]
2 Determine if the table exists
if exists (select * from sysobjects where id = object_id (n ' [table name] ') and
SQL trigger Instance 1Definition: What is a trigger? In SQL Server is a certain operation of a table, triggering certain conditions, thus executing a program. A trigger is a special stored procedure.
There are three common triggers: Apply to insert,
One, set mapping
1. Collection of small mediaset mapping is also a basic mapping, but not often used in the development process, so do not need a deep understanding, only need to understand the basic methods of use, etc. in the development process
Cases
The code is as follows
Copy Code
DELIMITER $$ DROP PROCEDURE IF EXISTS getuserinfo $$ CREATE PROCEDURE GetUserInfo (in Date_day datetime)----Example--MySQL stored procedure name: GetUserInfo--Parameter: date_day
Directly below the code
Copy Code code as follows:
Date_default_timezone_set ("Asia/shanghai");
/*
function Create_siteinfo
Done: Website Information table
Author:www.5dkx.com
Date:2010-3-30
Table structure:
Title Site name
server| Server | Issues-Data on a scheduled synchronization server (synchronization of data modifications on the server to local)
--Example:
--Test environment, SQL Server2000, remote server name: Rserver, username: ruser, password: rpwd,
Testing
--Tree Data query Example--Author: Jiangjian
if exists (SELECT * from dbo.sysobjects WHERE id = object_id (n ' [TB] ') and OBJECTPROPERTY (ID, n ' isusertable ') = 1)drop table [TB]GO
--Sample dataCREATE TABLE [TB] ([id] int identity (+), [PID]
1. Connection database format: mysql-h host address-u user name-P user password 1.1. Connect to MySQL on this computer. First open the DOS window, then enter the directory Mysql\bin, and then type the command Mysql-u root-p, enter after you are
I. Introduction to the MySQL storage process (technical text):A stored procedure is a programmable function that is created and saved in the database. It can consist of SQL statements and some special control structures. Stored procedures are useful
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.