I have the following code to insert a CSV file into a temp table:
USE [websitehere.com].[dbo]
GO
CREATE TABLE [websitehere.com].[dbo].[tmpTable]
(ID INT,
Caller_Number VARCHAR(100),
Caller_Name VARCHAR(100),
GroupBy VARCHAR(100),
Campaign_Name VARCHAR(100),
DateAndTime VARCHAR(100),
Duration VARCHAR(100),
Call_Status VARCHAR(100))
GO;
BULK
INSERT tmpTable
FROM 'C:\Users\namehere\Documents\CallLog.csv'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO
But…
-
It does not seem to add the
tmpTable. It gives me an errorMsg 102, Level 15, State 1, Line 1
Incorrect syntax near ‘.’. -
It won’t add the insert command saying that
Msg 4834, Level 16, State 4, Line 8
You do not have permission to use the bulk load statement.
Any help would be great to take care of these 2 errors!
Update

Ah found where i needed to grant access to be able to use it!