Home All Groups Group Topic Archive Search About

QUERY OUT - SQL SERVER 2000

Author
18 Aug 2005 7:39 PM
Macisu
I am using the following


--COPY DISK
DECLARE @FileName varchar(200),
        @bcpCommand varchar(2000)

SET @FileName =
REPLACE('C:\OUTPUT\'+CONVERT(char(8),GETDATE(),1)+'.txt','/','-')

SET @bcpCommand = 'bcp "SELECT Column COLLATE SQL_Latin1_General_CP437_CI_AS
FROM civ..SALIDAserfi ORDER BY Id " queryout "'
SET @bcpCommand = @bcpCommand + @FileName + '" -U sa -P 123 -c '

EXEC master..xp_cmdshell @bcpCommand
----------------------------------------------------------------------------------------
QUESTION ----------------------------------------------------------------------------------------


My table in SQL SERVER appears the following:

PARA UN MEJOR SERVICIO. SE HA DISEÑADO

but in the moment of to write to disk :

PARA UN MEJOR SERVICIO. SE HA DISEÂ¥ADO UN

I need to write ñ NOT ¥

How to fix the caracter ñ (¥)?

What can I do?

Thanks

Macisu

Author
18 Aug 2005 9:03 PM
Alejandro Mesa
Macisu,

Try using the "-w" argument.


AMB

Show quote
"Macisu" wrote:

> I am using the following
>
>
> --COPY DISK
> DECLARE @FileName varchar(200),
>         @bcpCommand varchar(2000)
>
> SET @FileName =
> REPLACE('C:\OUTPUT\'+CONVERT(char(8),GETDATE(),1)+'.txt','/','-')
>
> SET @bcpCommand = 'bcp "SELECT Column COLLATE SQL_Latin1_General_CP437_CI_AS
> FROM civ..SALIDAserfi ORDER BY Id " queryout "'
> SET @bcpCommand = @bcpCommand + @FileName + '" -U sa -P 123 -c '
>
> EXEC master..xp_cmdshell @bcpCommand
>
> ----------------------------------------------------------------------------------------
> QUESTION
> ----------------------------------------------------------------------------------------
>
>
> My table in SQL SERVER appears the following:
>
> PARA UN MEJOR SERVICIO. SE HA DISEÑADO
>
> but in the moment of to write to disk :
>
> PARA UN MEJOR SERVICIO. SE HA DISEÂ¥ADO UN
>
> I need to write ñ NOT ¥
>
> How to fix the caracter ñ (¥)?
>
> What can I do?
>
> Thanks
>
> Macisu
Author
18 Aug 2005 9:24 PM
Macisu
Thanks

using -w not problem.

;)
Show quote
"Alejandro Mesa" wrote:

> Macisu,
>
> Try using the "-w" argument.
>
>
> AMB
>
> "Macisu" wrote:
>
> > I am using the following
> >
> >
> > --COPY DISK
> > DECLARE @FileName varchar(200),
> >         @bcpCommand varchar(2000)
> >
> > SET @FileName =
> > REPLACE('C:\OUTPUT\'+CONVERT(char(8),GETDATE(),1)+'.txt','/','-')
> >
> > SET @bcpCommand = 'bcp "SELECT Column COLLATE SQL_Latin1_General_CP437_CI_AS
> > FROM civ..SALIDAserfi ORDER BY Id " queryout "'
> > SET @bcpCommand = @bcpCommand + @FileName + '" -U sa -P 123 -c '
> >
> > EXEC master..xp_cmdshell @bcpCommand
> >
> > ----------------------------------------------------------------------------------------
> > QUESTION
> > ----------------------------------------------------------------------------------------
> >
> >
> > My table in SQL SERVER appears the following:
> >
> > PARA UN MEJOR SERVICIO. SE HA DISEÑADO
> >
> > but in the moment of to write to disk :
> >
> > PARA UN MEJOR SERVICIO. SE HA DISEÂ¥ADO UN
> >
> > I need to write ñ NOT ¥
> >
> > How to fix the caracter ñ (¥)?
> >
> > What can I do?
> >
> > Thanks
> >
> > Macisu

AddThis Social Bookmark Button