November 21, 2014 at 8:45 am
I am attempting to import data from a text file customtextout.txt (data in file is separated by a comma), but not having much luck. I freely admit I have no idea what I am doing, adapting code I have found on-line. I get the following error:
Copy direction must be either in, out or format
My ultimate goal is to turn this into a batch file that I can run with Task Scheduler.
bcp Pats Weather.dbo. TestTable "in C:\wdisplay\webfiles\customtextout7.txt -c –t, -S localhost\PSIMONDS\SQLEXPRESS -T
November 21, 2014 at 9:13 am
It seems that you have some things that don't belong there.
bcp Weather.dbo.TestTable in C:\wdisplay\webfiles\customtextout7.txt -c -S localhost\PSIMONDS\SQLEXPRESS -T
Read more about bcp in here:
http://msdn.microsoft.com/en-us/library/ms162802.aspx
http://www.sqlservercentral.com/articles/BCP+(Bulk+Copy+Program)/105867/
November 21, 2014 at 11:07 am
this looks wrong.
it should be either localhost\instance or machinename\instance
so i'd expect some of these to be right:
-S localhost\SQLEXPRESS
-S .\SQLEXPRESS
-S PSIMONDS\SQLEXPRESS (asuming your machine is named PSIMONDS!)
-S 127.0.0.1\SQLEXPRESS
Lowell
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply