views:

71

answers:

0

bulk upload from csv test file

"\servername\wwwroot\Upload\LDSAgentsMap.txt"

     SET QUOTED_IDENTIFIER ON
SET ANSI_NULLS ON
GO

CREATE PROCEDURE [dbo].[sp_CSVTest_BulkInsert] ( @Path NVARCHAR(128) )
AS 
    DECLARE @Sql NVARCHAR(256)
    SET @Sql = 'BULK
INSERT CSVTest 
FROM ''' + @Path + ''' WITH
(
FIELDTERMINATOR = '','',
ROWTERMINATOR = ''\n''
)'
--PRINT @Sql
EXEC(@Sql)

GO

path is "\servername\wwwroot\Upload\LDSAgentsMap.txt"

note

this is in shared hosting and database user have blukadmin and public service role

related questions