[root@server-mysql bin]# mysql_convert_table_format --help Conversion of a MySQL tables to other storage engines Usage: /usr/bin/mysql_convert_table_format database [table[ table ...]] 1.If no tables has been specifed, all tables in the database will…
修改表名 ALTER TABLE 原表名 RENAME TO 新表名; 一句SQL语句只能修改一张表 show tables; 1. SELECT CONCAT( 'ALTER TABLE ', table_name, ' RENAME TO db_', substring(table_name, ), ';' ) FROM information_schema. TABLES WHERE table_name LIKE 'ct%'; 批量复制一下到Notepad++中,只保留sql语句,再复制…
SELECT NAME FROM SYS. ALL_OBJECTS WHERE TYPE= 'U' ORDER BY MODIFY_DATE DESC --查询所有表名 SELECT NAME FROM SYS. ALL_OBJECTS WHERE TYPE= 'U' AND name LIKE '%\_0%' escape '\' AND name NOT LIKE '%_OLD' ORDER BY MODIFY_DATE DESC DECLARE @COUNT INT ) ) )…
项目中发现一批语言表的某个字段设的值太小了需要增大,因为涉及到很多张表,所以采用游标一张张的处理. 代码很简单 ) ) DECLARE LangTable CURSOR FOR SELECT name FROM sys.tables WHERE name LIKE '%Language' OPEN LangTable FETCH NEXT FROM LangTable INTO @tableName BEGIN SET @sql = 'ALTER TABLE '+@tableName+' ALT…