x
login about faq Site discussion (meta-askssc)

How do you make BCP not to display output?

I have a query that uses BCP to output results to a file. I would like to supress the results of the BCP and replace them with my own custom message. i.e I would like to replace:

NULL
Starting copy...
1000 rows successfully bulk-copied to host-file. Total received: 1000
1000 rows successfully bulk-copied to host-file. Total received: 2000
NULL
2000 rows copied.
Network packet size (bytes): 4096
Clock Time (ms.) Total     : 1719   Average : (132329.84 rows per sec.)
NULL

with

'Query executed successfully'

Thanks

more ▼

asked Dec 09 '09 at 01:25 PM in Default

benson gravatar image

benson
26 2 2 2

(comments are locked)
10|1200 characters needed characters left

3 answers: sort voted first

Sorry, the user running the script simply has to click on the 'Messages' tab to get my comments. I need a nap!

more ▼

answered Dec 09 '09 at 01:34 PM

benson gravatar image

benson
26 2 2 2

Can you mark your question as answered?

Dec 10 '09 at 07:00 AM Mark Allison
(comments are locked)
10|1200 characters needed characters left

Assuming you are using xp_cmdshell to invoke BCP, then you can suppress the results from being displayed by including the no_output option.

There is information about it at: http://msdn.microsoft.com/en-us/library/aa260689(SQL.80).aspx

more ▼

answered Dec 11 '09 at 05:36 PM

TimothyAWiseman gravatar image

TimothyAWiseman
14.3k 17 20 29

(comments are locked)
10|1200 characters needed characters left

alt text

bcp.jpg (16.1 kB)
more ▼

answered Aug 09 '12 at 05:42 AM

ramesh 1 gravatar image

ramesh 1
1.7k 46 63 68

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x914
x36

asked: Dec 09 '09 at 01:25 PM

Seen: 2552 times

Last Updated: Aug 09 '12 at 09:21 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.