如何将电子表格导入Excel并将其Excel导入数据库?

问题描述

嗨,大家好,我正在尝试从excel工作表中跨三个不同的表导入一些数据,我想知道如何做到这一点,而我在实际导入excel中找不到任何东西。我不知道如何为此编写智能的INSERT。帮助!

这是我的表结构。

工作{ [id] [entity_id] [round_id] [company_id] [address_id] [vendor_id] [first_service_date] [name] [price] [type] [status] [notes] [vendor_sort_id] [subcontractor_sort_id] [job_type_id] [auto_complete] [aworka_slug ] [deleted_at] [created_at] [updated_at] [use_fixed_price] [fixed_price] [store_code} [last_service_date] [is_credit_note] }

Frequency_Rule_Job { [id] [job_id] [frequency_rule_id] [effective_from] [created_at] [updated_at] [deleted_at] [is_active] }

Frequency_Rules { [id] [freq] [interval] [week_days] [company_id] [text] [created_at] [updated_at] [json_week_days] [setpos] [count] [deleted_at] }

以下是示例数据

工作

enter image description here

频率规则

![enter image description here

频率规则工作

enter image description here

这是我要大量插入的Excel数据。

enter image description here

编辑:忘记添加我的数据库是MySQL

解决方法

如果您的数据库是Microsoft SQL Server,请创建一个SSIS(SQL Server Integration Services)项目,然后将excel数据插入到您想要的数据库中。

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...