October 8, 2012 at 1:16 pm
Server 2008:ABC
Database:DEF
Stored proc:up_CheckProc";1 'ZZZ', 1, 0, 1, 1, '2020-04-01 00:00:00.000', '2040-09-30 23:59:29.000', '', '', '', '', '', '', '', '', '', '', '
Output should be to E drive:E:\output.txt in pipe delimited format
I keep getting this error message : Copy direction must be either 'in', 'out' or 'format'.
How I execute this from command line prompt
October 8, 2012 at 1:24 pm
you didn't show your bcp commnad at all.
in theory, it will look something like this, assuming calling from xp_cmdshell:
EXECUTE master.dbo.xp_cmdshell 'bcp "EXEC DatabaseName.dbo.up_CheckProc";1 ''ZZZ'', 1, 0, 1, 1, ''2020-04-01 00:00:00.000'', ''2040-09-30 23:59:29.000'', '''', '''', '''', '''', '''', '''', '''', '''', '''', '''', '''' " queryout E:\Output.txt -c -T'
Lowell
October 8, 2012 at 1:37 pm
for the pipe delimited row terminator, you need to add -t"|" to the command ; see bcp /? from a command prompt for all the options.
Lowell
December 3, 2013 at 12:08 am
To use a pipe delimiter between each field, use the -t "|" option. -r is the row delimiter
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply