在create table的语句中,key和index混淆在一起,官方手册中的解释是这样: KEY is normally a synonym for INDEX. The key attribute PRIMARY KEY can also be specified as just KEY when given in a column definition. This was implemented for compatibility with other database systems.
1.建表 1 IF object_id (N'表名', N'U') IS NULL CREATE TABLE 表名 ( 2 id INT IDENTITY (1, 1) PRIMARY KEY ,......); 2.查询所有满足条件的表 1 SELECT 2 NAME 3 FROM 4 sys.objects 5 WHERE 6 type = 'u' 7 AND NAME LIKE 'test_%'; 3.批量删除满足条件的表 1 DECLARE 2 @NAME VARCHAR (
ERROR 1005: Can't create table (errno: 121) errno 121 means a duplicate key error. Probably the table already exists in the InnoDB internal data dictionary, though the .frm file for the table has been deleted. This is themost common reason for gettin