Path: csiph.com!usenet.pasdenom.info!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!217.73.144.45.MISMATCH!feeder2.ecngs.de!ecngs!feeder.ecngs.de!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 22 Jun 2012 16:45:23 -0500 From: "Cathy" Newsgroups: comp.databases.ms-sqlserver References: <5oudnZwNaMRT-37SnZ2dnUVZ8g-dnZ2d@bt.com> <1JudnbRjP9BoMnnSnZ2dnUVZ8lmdnZ2d@bt.com> In-Reply-To: Subject: Re: MSSMSE - Export results to CSV Date: Fri, 22 Jun 2012 22:45:16 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Windows Mail 6.0.6002.18197 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18463 Message-ID: Lines: 14 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-AZ7uOU67CeXAQh++KHLiRsu8bi1qEgBNxhrH4kAhS5AFj5b8Fv1kwxOyyv41MublMc6OjrbZuMpwCa6!/6JFrjUC/C13MlbIaUPeDe8etlfYJTzfvq8rGQpV3oeUNH0PRahk2FiGuhBNTjTvIK8aFOAuDz4= X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1890 Xref: csiph.com comp.databases.ms-sqlserver:1153 This is brilliant > SELECT CategoryID, CategoryName, quotename(Description, '"') > FROM [Northwind].[dbo].[Categories] Only problem I have now is that bcp reads the quote as the end of the command. Is there a way to escape this? bcp "SELECT CategoryID, CategoryName, quotename(Description, '"')FROM [Northwind].[dbo].[Categories]" queryout outputfile.csv Thanks so much for your help to so far C