1

I have table with the following Scheme

 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]

I needs to implement the bulk Insert to the above table with SSIS package

My flat file format is like this..

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

How can i do the bulk insert with out changing this file format (If i add the '||' in the starting of the file format..it is working fine..But it is not allowed..)

Elby Joy
  • 231
  • 1
  • 7
  • I'm not expert with SSIS, but why would adding `||` to the start of the data file make it work? It seems like this is just a delimiter problem to me. – Tim Biegeleisen Mar 26 '18 at 06:21
  • 1
    We are not provide the Value for the column 'ID' in the file format. It is auto increment column.So when we add the '||' in the starting and keeps as blank. It is working bcos it is consider as the value for the ID..and working.. – Elby Joy Mar 26 '18 at 06:31
  • Your question seems to be a duplicate of this one: https://stackoverflow.com/questions/10851065/bulk-insert-with-identity-auto-increment-column?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa ... but I won't bang shut, because I'm not 100% certain. – Tim Biegeleisen Mar 26 '18 at 06:33

0 Answers0