excel工作表和sql文件中的多个表需要作为输出

时间:2012-10-26 07:56:00

标签: sql excel

我有一个excel工作表,其中包含大量50个表定义。表定义如下:

Table School
Name Varchar2 20
Marks Number 5

这些值位于excel的不同列中,并且有很多类似的表。 现在我需要使用excel文件生成一个sql脚本。输出脚本应包含所有表的create table statemnts。我只需要所有表的sql脚本。 让我知道我该怎么做。

1 个答案:

答案 0 :(得分:0)

使用宏youtube.com/watch?v=ABXa6X18nyo。

另一种方法是连接字符串,例如 enter image description here

="create table "&B1&"("&A2&" "&B2&","&A3&" "&B3&");"

在任何其他列中键入此项,您将获得结果为`create table School(Name Varchar2 20,Marks Number 5);

此次访问http://www.dummies.com/how-to/content/how-to-join-text-strings-in-excel-2010-with-the-op.html `