By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,157 Members | 891 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,157 IT Pros & Developers. It's quick & easy.

copy from a txt file on a network drive

P: 1
I am running a SQL Script called from a batch file to build a temp database from a flat file.

It works when the flat is on the C: drive but not on a net work drive
I get this error:

ERROR: could not open file "\\ESSOMAFPS5\Pollbook\Data\STREET_DATA.txt" for reading: Invalid argument

Here is the copy statement... I am using the \\ UNC name in my call

BEGIN;

---------------------------
-- import_STREET_DATA
---------------------------------------------------------------TRUNCATE temp.import_STREET_DATA;

COPY temp.import_STREET_DATA

FROM '\\\\ESSOMAFPS5\\Pollbook\\Data\\STREET_DATA.txt'

WITH DELIMITER E'|'
CSV HEADER
NULL AS '';

-- INSERT LOG
SELECT temp.temp_log('3.0', 'temp.import_STREET_DATA', 'INSERT', 'TRUNCATED AND REFRESHED WITH DATA FROM FILE.');

COMMIT;

I have also tried the /copy command and receive this error

ERROR: syntax error at or near "/"
LINE 1: /COPY temp.import_STREET_DATA
Sep 3 '14 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.