Just use SHOW CREATE TABLE SHOW CREATE TABLE my_table See also: How to generate a CREATE TABLE statement for a given table in SQL Server How to generate a CREATE TABLE statement for a given table in Oracle How to generate a CREATE TABLE statement for a given table in SQLite Some MySQL tools you ... Read more
Tag Archives: generate a CREATE TABLE statement
How to generate a CREATE TABLE statement for a given table in Oracle
select dbms_metadata.get_ddl('TABLE', 'the_table_name', 'the_schema_name') from dual Replace “the_table_name” and “the_schema_name” with yours. See also: How to generate a CREATE TABLE statement for a given table in SQL Server How to generate a CREATE TABLE statement for a ... Read more
How to generate a CREATE TABLE statement for a given table in SQL Server
declare @table varchar(100) set @table = 'my_table' -- set table name here declare @sql table(s varchar(1000), id int identity) -- create statement insert into @sql(s) values ('create table [' + @table + '] (') -- column list insert into @sql(s) select ' ['+column_name+'] ' + ... Read more