Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bulk insert from CSV on local drive
Message
From
16/04/2019 12:04:59
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01668114
Message ID:
01668128
Views:
45
So, it sounds like I'm gonna have to bite the bullet and figure out how to get the SSIS to work.
Right then, on to it.

>The account SQL Server is running under have to have permission to the folder with a file.
>It gets even more complicated if you are trying to do that on remote SQL Server because BULK INSERT will run on it, not localy
>
>>I'm trying to create a stored proc that will do a Bulk Insert into a temp table from a csv on my local drive
>>
>>CREATE table [#tfCSO](
>>	[Personkey] [int] NOT NULL,
>>	[LastName] [varchar](50) NULL,
>>	[FirstName] [varchar](30) NULL,
>>	[MName] [varchar](30) NULL,
>>	[CSCD] [varchar](30) NULL,
>>	[CSO] [char](1) NULL,
>>	[CSTSID] [varchar](10) NULL,
>>	[OfficerType] [char](2) NULL,
>>	[Inactive] [char](2) NULL
>>) 
>>
>>bulk insert #tfCSO
>>from 'c:\OTReg\TF0416.csv'
>>with
>>( Firstrow = 2,
>>  FieldTerminator = ',',
>>  Rowterminator = '\n',
>>  Tablock
>>)
>>
>>other stuff here
>>--drop table #tfCSO
>>
>>
>>SQL keeps telling me "Cannot bulk load because the file...could not be opened.
>>No, I don't have the file open in Excel.
>>And no, I don't want to create an SSIS package, tried that - couldn't get to the temp table afterward.
>>
>>What am I missing?
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Previous
Reply
Map
View

Click here to load this message in the networking platform