June 9, 2011 at 11:19 am
I have never used BCP before and need to create a piped extract from one of our databases. I am entering:
https://www.sqlservercentral.com/ConfirmRegistration?levm4ZTf0PQ%2fFZM9HcjPaA%3d%3d
and I get the following error message:
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'queryout'.
What am I doing wrong?
thanks
June 9, 2011 at 12:18 pm
I think you may have copy-and-pasted the wrong string into your post.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
June 9, 2011 at 12:22 pm
i've used this for pipe delimited; does this help?
EXECUTE master.dbo.xp_cmdshell 'bcp "SELECT object_name(object_id) As TbLName,name as ColName FROM SandBox.sys.columns ORDER BY object_name(object_id), column_id" queryout C:\Data\Objects.txt -t"|" -c -T '
Lowell
June 9, 2011 at 12:26 pm
definitely having one of those days.......
BCP "select * from tier_production.dbo.rpt_PatBalBadDebt" queryout compass.txt -c -T -t "|"
June 9, 2011 at 12:27 pm
yes it does...
June 9, 2011 at 12:30 pm
Just ran this:
C:\Users\Steve>bcp "select * from db1.dbo.mytable" queryout out.txt -C -T -t "|" -S sevenfalls
I didn't see a server name in yours.
June 9, 2011 at 12:36 pm
got it working....thanks to all
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply