I am trying to write a bulk import routine so that i will be able to import text files or csv files to SQL i have tried this and it's giving me the following error message. P: is the drive where the file is in currently.
USE [XYZABQ] GO CREATE TABLE CSVTest (ID INT, [Name] VARCHAR(40), Surname VARCHAR(40), BirthDate DATETIME (10)) GO BULK INSERT CSVTest FROM 'P:\csvtest.txt' WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ) GO
Msg 4861, Level 16, State 1, Line 2
Cannot bulk load because the file "P:\csvtest.txt" could not be opened. Operating system error code 3(error not found).