- 現在想將文件夾中的多個Excel文件批量導入數據庫中,且放在同一張表中
- 工具:SQL Server數據庫,Microsoft SQL Management Studio(SSMS),Microsoft Visual Studio(SSDT)
- 注意:要求所有的excel文件sheet名,字段名一致
首先,在數據庫中新建一張表,字段名與excel文件中的字段一致
USE [Kingfisher_test]
GO
/****** Object: Table [dbo].[SAP_Sales_GM_Stock] Script Date: 2020/3/20 13:49:13 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SAP_Sales](
[Year and Month] [nvarchar](255) NULL,
[Office] [nvarchar](255) NULL,
[Leading Category] [nvarchar](255) NULL,
[Category Name] [nvarchar](255) NULL,
[Vendor Name] [nvarchar](255) NULL,
[Sales Value] [float] NULL,
[Gross Margin] [float] NULL,
[Net Margin] [float] NULL,
[Sales Quantity] [float] NULL,
[DC Quantity] [float] NULL,
[DC Value] [float] NULL,
[Store Quantity] [float] NULL,
[Store Value] [float] NULL
) ON [PRIMARY]
GO
打開SSD