Did you try this :-
Create table TableDef select * from TableX where 1 = 2;
If you give this statement you will create the new table "TableDef" with the
same variables and datatypes as table "TableX"
Let me know if it works....
On Tue, May 11, 2010 at 9:06 PM, mos <mos99@stripped> wrote:
> I'd like to get the field names and data types of a table, say TableX, and
> put it into TableDef using nothing but SQL. I know I can list the table
> definition using "Describe Table" and then loop through the results and
> insert the first two columns Field and Type into TableDef, but is there a
> way to do it using just SQL?
> Describe TableX:
> First_Name Char(15) ....
> Last_Name Char(20) ...
> Start_Date Date ..
> Salary Double ..
> And I'd like TableDef to have these rows:
> ColName ColType
> --------------- --------------
> First_Name Char(15)
> Last_Name Char(20)
> Start_Date Date
> Salary Double
> Is there a way to do this with one SQL statement? I'm really looking for
> the MySQL internal table where it stores the table definitions.
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: