张暖雅全婐照片原图,九道婴仙,noopenqq
代码实现批量生成sql语句
select concat( 'alter table ', table_schema, '.', table_name, ' modify column ', column_name, ' ', column_type, ' ', #if(is_nullable = 'yes', ' ', 'not null '), if(column_default is null, '', if( data_type in ('char', 'varchar') or data_type in ('date', 'datetime', 'timestamp') and column_default != 'current_timestamp', concat(' default ''', column_default,''''), concat(' default ', column_default) ) ), if(extra is null or extra='','',concat(' ',extra)), ' comment ''', column_comment, ''';' )col from information_schema.columns where table_schema = 'whiski'; #and table_name = 'ws_adminuser'
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
数据库SQL---数据库、基本表、视图、索引的定义、修改、删除
在 Azure CentOS VM 中配置 SQL Server 2019 AG - (上)
在 Azure CentOS VM 中配置 SQL Server 2019 AG - (下)
网友评论