Excel中建表语句的语法是什么?

发布于 2024-07-30 12:21:30 字数 226 浏览 2 评论 0原文

我正在使用 ODBC,如果需要将大约 3 种不同类型的数据转储到不同的 Excel 工作表,则可以使用 OLE。 但我相信,要在 Excel 中使用插入语句,必须首先创建表,尤其是在工作表尚不存在的情况下。

我曾经使用sql server 2000的导入/导出向导来自动生成建表语句。

那么有谁知道 create 语句的数据类型和语法或 excel sql create 语句的良好资源的位置?

I'm using ODBC, OLE is available if needed to dump approx 3 different types of data to different excel sheets. But to use insert statements in excel, the table has to be created first I believe, especially if the sheet doesn't exist yet.

I used to use sql server 2000's import/export wizard that automatically generated the create table statement.

So does anyone know the data types, and syntax for a create statement or the location of a good resource for excel sql create statements?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

何其悲哀 2024-08-06 12:21:30

因此,这很容易找到,这里有一个来自 Leonel Martins 链接的示例:

CREATE TABLE DataSource
(Staff_Nox NUMBER,
Salx CURRENCY,
Namex TEXT,
Boolyx BIT,
Regionx NUMBER,
Datex DATETIME)

另外值得注意的是,对于文本和日期时间,它似乎想要将数据包装在特殊字符中:

Select Case fGetCellFormat(.Cells(2, viCount))

    Case "TEXT"

        vtWrapChar = """" 

    Case "DATETIME"

        vtWrapChar = "#" 

    Case Else

        vtWrapChar = "" 

End Select

我可以发誓还有更多类型,例如 char 和 varchar

So that this is easy to find here's an example from Leonel Martins' Link:

CREATE TABLE DataSource
(Staff_Nox NUMBER,
Salx CURRENCY,
Namex TEXT,
Boolyx BIT,
Regionx NUMBER,
Datex DATETIME)

Also of note is that for text and datetime it appears to want to wrap data in a special character:

Select Case fGetCellFormat(.Cells(2, viCount))

    Case "TEXT"

        vtWrapChar = """" 

    Case "DATETIME"

        vtWrapChar = "#" 

    Case Else

        vtWrapChar = "" 

End Select

I could swear there were more types, like char and varchar

十级心震 2024-08-06 12:21:30

该表上给我的创建表语法失败并显示以下消息
无法修改表“数据”的设计,它是只读数据库。

使用 OleDb 这有效:

CREATE TABLE `sheetname` (
`DartNumber` VarChar (16)
, `ClientId` VarChar (10)
, `Population` VarChar (30))

但由于某种原因未能使用 odbc 表示只读。

The create table syntax given to me on that sheet failed with the message
Could not modify the design of table 'Data' it is a read-only database.

Using OleDb This worked:

CREATE TABLE `sheetname` (
`DartNumber` VarChar (16)
, `ClientId` VarChar (10)
, `Population` VarChar (30))

but for some reason failed saying read-only using odbc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文