6
Answers

Bulk Copy with IDENTITY

Joshua Harris

Joshua Harris

13y
4.4k
1
 

CREATE TABLE [dbo].[litSDO](

      [litSDOId] [int] IDENTITY(1,1) NOT NULL,

      [OrderId] [int] NULL,

      [FSBId] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

      [TMR] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

      [Qty] [int] NOT NULL,

      [EventDate] [smalldatetime] NULL,

      [JobNumber] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL

) ON [PRIMARY]

 

 

 

File : (.txt)

 

"Order_ID","FSB_ID","TMR","Qty","EVENT_DATE","job_number"
2473887,"BOS","FJ780",1,2011-05-19 12:48:12,"G3191116"
2473888,"BOS","G377T",1,2011-05-19 12:48:14,"G3191131"
2473889,"BOS","HP592",1,2011-05-19 12:48:14,"G3191131"
2473926,"DC","28Y5M",1,2011-05-19 12:54:12,"G3191315"

 

 

I need to upload this into a SQL table and keepidentity. Also need to start the import at the 2nd line (ignoring the header)

Answers (6)