declare @SQL nvarchar(max) = '
CREATE TABLE #TempTable
( [Field1] nvarchar(max) NULL,
[Field2] nvarchar(max) NULL,
[Field3] nvarchar(max) NULL );
BULK INSERT #TempTable FROM ''<FullPath>FileName.csv'' WITH --if the path is in the network - need to write the Full-path of the drive
(
KEEPIDENTITY,
FIELDTERMINATOR = '','',
MAXERRORS = 10000,
KEEPNULLS,
ROWTERMINATOR=''
'',
FIRSTROW = 2,
CODEPAGE = ''1255''
);
select * from #TempTable
Insert into TableNameInDB(Field1,Field2,Field3)
select * from #TempTable
'
EXEC sp_executesql @SQL