x

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, 2009 at 01:25 PM in Default

avatar image

benson
26 2 2 3

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

5 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, 2009 at 01:34 PM

avatar image

benson
26 2 2 3

Can you mark your question as answered?

Dec 10, 2009 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, 2009 at 05:36 PM

avatar image

TimothyAWiseman
15.6k 22 51 38

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

alt text

bcp.jpg (16.1 kB)
more ▼

answered Aug 09, 2012 at 05:42 AM

avatar image

ramesh 1
2.2k 66 69 73

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

hi

more ▼

answered Mar 11, 2014 at 08:19 AM

avatar image

jallo
1

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

hello i need help

more ▼

answered Mar 11, 2014 at 08:21 AM

avatar image

jallo
1

(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

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x1066
x49

asked: Dec 09, 2009 at 01:25 PM

Seen: 8256 times

Last Updated: Mar 11, 2014 at 08:21 AM

Copyright 2016 Redgate Software. Privacy Policy