使用SSIS包批量插入到具有IDENTITY列的表

时间:2018-03-26 06:11:20

标签: sql sql-server sql-server-2008 ssis

我有以下方案的表格

 CREATE TABLE [dbo].[ACCOUNT](
[ID] [numeric](18, 0) IDENTITY(1,1) NOT NULL,
[ACCOUNT_ID] [varchar](50) NULL,
[ALTERNATE_ACCOUNT_ID] [varchar](50) NULL,
[ACCOUNT_NAME] [nvarchar](100) NULL,
[POSTING_RESTRICT] [nvarchar](100) NULL,
[INACTIVE_MARKER] [nvarchar](100) NULL,
[ACCOUNT_TYPE] [nvarchar](100) NULL,
[CATEGORY_CODE] [nvarchar](100) NULL,
[Letter_UnderTaking] [nvarchar](1) NULL,
[Account_Currency] [nvarchar](3) NULL,
[Target_Customer] [nvarchar](2) NULL,
[Sector] [varchar](50) NULL,
[Nationality] [varchar](10) NULL,
[LegalID] [varchar](50) NULL,
[NationalID] [varchar](50) NULL,
[TradeLicenseNo] [varchar](50) NULL,
[T24IndustryCode] [varchar](15) NULL,
[CustomerMobileNo] [varchar](50) NULL,
[CustomerID] [varchar](50) NULL,
[Posting_Restrict_Desc] [varchar](500) NULL,
 CONSTRAINT [PK_ACCOUNT] PRIMARY KEY CLUSTERED 
 (
[ID] ASC
 )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, 
 ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 96) ON [PRIMARY]
 ) ON [PRIMARY]

我需要使用SSIS包

实现对上表的批量插入

我的平面文件格式是这样的..

2056001006142014 || 9876543211 || FGBCUST_NAME2 |||| TEST || SAVINGS帐户|| 6000 || Y || AED || 30 |||| AE || 123 || 123456789 || 223344556677 || 999 || 99657432561 || TESTCUSTID || POSTING DESC

如何在不更改此文件格式的情况下执行批量插入(如果我在文件格式的开头添加'||',则工作正常..但是不允许..)

0 个答案:

没有答案