create or replace trigger t before update on test5 for each rowbegin insert into test55 values (:old.id,:old.name);end ; -------------------------------------------------------------------------------------- --表中插入数据时ID自动增长 create table ttt (id numbe
declare @tablename varchar(200)declare @sql varchar(2000)declare cur_t cursor forselect name from sysobjects where xtype= 'U ' and status> =0 and name not in (select name from sysobjects where id in (select id from syscolumns where id in (select id f
http://kb.cnblogs.com/a/2357592/很多情况下,我们要提前用到当前某个表的auto_increment自增列id,可以通过执行sql语句来查询到这个id值. show table status where name=’表名’ 或者 show table status like ‘表名’ 然后从查询到的结果集中获得auto_increment的值 代码实例:<?php mysql_connect("localhost","root",
SQL INSERT INTO 语句(在表中插入) INSERT INTO 语句用于向表中插入新记录. SQL INSERT INTO 语句 INSERT INTO 语句用于向表中插入新记录. SQL INSERT INTO 语法 INSERT INTO 语句可以用两种形式编写. 第一个表单没有指定要插入数据的列的名称,只提供要插入的值: INSERT INTO table_name (column1, column2, column3, ...) VALUES (value1, value2,