Sunday, March 11, 2012

Cannot use the OUTPUT option when passing a constant to a stored p

Hi,
I'm trying to export a text column into a text file using the bcp command
but I keep getting the error message in the subject line. So I checked the
database properties and didn't find anything.
My Code:
bcp "Select Replace(Str(UNITNUM, 12, 0), ' ', '0') FROM PICUadmissions
WHERE Admit_Date>'2005-06-01' and Admit_Date<'2005-07-01'" out
"I:\sttr\STTRLabsIn.txt" -c -T
go
Does anyone know why I am getting this message?
Much Appreciated,
ChiekoError message? Wish I could see it.
ML|||Since your BCP source is a query rather than a table/view, you need to
specify 'queryout' instead of 'out'.
Hope this helps.
Dan Guzman
SQL Server MVP
"chieko" <chieko@.discussions.microsoft.com> wrote in message
news:A82B768C-9367-447E-81DE-8EBFFAFBD62C@.microsoft.com...
> Hi,
> I'm trying to export a text column into a text file using the bcp command
> but I keep getting the error message in the subject line. So I checked the
> database properties and didn't find anything.
> My Code:
> bcp "Select Replace(Str(UNITNUM, 12, 0), ' ', '0') FROM PICUadmissions
> WHERE Admit_Date>'2005-06-01' and Admit_Date<'2005-07-01'" out
> "I:\sttr\STTRLabsIn.txt" -c -T
> go
> Does anyone know why I am getting this message?
> Much Appreciated,
> Chieko
>

No comments:

Post a Comment