Failed to export to a text file
- From: Gonzalo <gonzaloos85@xxxxxxxxx>
- Date: Sun, 1 Mar 2009 21:21:04 -0800 (PST)
Hi.
I am exporting data from one table to one text file, sometimes the
export works well. But sometimes you create a text file filler of
several "square and crosses" and some white space.
When you paste the text into Word is something like this:
〲㠰〯〰㐲ⴱ㈉〰⼸〰㈰ㄴ〭रउ㠵䄉〰〰लぁ〰㈰䄉〰〰ल〲㠰ㄭⴱ㠲〠㨰〰〺⸰〰र〮〰र〵⸵㌵㔉㔰㔮ळざ‱†††उ〱〸㐴㜲㠲ललऱ晅॥䍂ㅐ⸉〰
〰⸉〰⸉〰⸉〰⸉〰⸉〰〰䴉湥畳污ㄉ〮〰र〳उ〮〰र〮〰रउ〲㠰ㄭⴲ㔰〠㨰〰〺⸰〰र〲㠰ㄭⴲ㠲〠㨰〰〺⸰〰र㈉〰ⴸ〭‵〰〺㨰〰〮〰㈉〰ⴸ㈱㈭‸
〰〺㨰〰〮〰उउ䙅ॅउउㄉ 按獥牡ഉ㈊〰⼸〰㈰㌴〭ऱ〲㠰〯〰㐲ⴳ〰उ㔉सぁ〰㈰䄉〰〰लぁ〰㈰㈉〰ⴸ㈱㈭‸〰〺㨰〰〮〰⸉〰〰㜉㜰㜮ल〷⸷㈷嘉
†††ठㄉ㠰㐰㈴㈷㈸㈉ㄉ䔉敦䈉偃ऱ〮〰र〮र〮र〮र〮र〮〰र敍獮慵६⸱〰
The table has only 7 records.
declare @f1 varchar (500)
declare @scrip varchar (2000)
declare @bcpCommand varchar (4000)
Set @f1 = 'D:\ '
Set @scrip = 'SELECT campo1 ,campo2 ……. MAS CAMPOS FROM [BD1].[dbo].
[Tabla1]'
SET @bcpCommand = 'bcp "'+@scrip + '" queryout "'
SET @bcpCommand = @bcpCommand + @f1 + 'mitexto.txt' + '" -U sa -P -c'
EXEC master..xp_cmdshell @bcpCommand
The fields of the table are varchar, char datetime, numeric and
bit ,and many of them admit null values
To export text, there's something you need to set? , some options
I can help with this problem, I will thank a lot.
Working with SQL Server 2000.
Something that will see the size of the records.
/*
Hola.
Estoy exportar datos de una tabla a un archivo de texto, a veces
funciona bien a la exportación. Pero a veces se crea un archivo de
texto de relleno de varios "cruces y cuadrados", y algunos espacios en
blanco.
Al pegar el texto en Word es algo como esto:
〲㠰〯〰㐲ⴱ㈉〰⼸〰㈰ㄴ〭रउ㠵䄉〰〰लぁ〰㈰䄉〰〰ल〲㠰ㄭⴱ㠲〠㨰〰〺⸰〰र〮〰र〵⸵㌵㔉㔰㔮ळざ‱†††उ〱〸㐴㜲㠲ललऱ晅॥䍂ㅐ⸉〰
〰⸉〰⸉〰⸉〰⸉〰⸉〰〰䴉湥畳污ㄉ〮〰र〳उ〮〰र〮〰रउ〲㠰ㄭⴲ㔰〠㨰〰〺⸰〰र〲㠰ㄭⴲ㠲〠㨰〰〺⸰〰र㈉〰ⴸ〭‵〰〺㨰〰〮〰㈉〰ⴸ㈱㈭‸
〰〺㨰〰〮〰उउ䙅ॅउउㄉ 按獥牡ഉ㈊〰⼸〰㈰㌴〭ऱ〲㠰〯〰㐲ⴳ〰उ㔉सぁ〰㈰䄉〰〰लぁ〰㈰㈉〰ⴸ㈱㈭‸〰〺㨰〰〮〰⸉〰〰㜉㜰㜮ल〷⸷㈷嘉
†††ठㄉ㠰㐰㈴㈷㈸㈉ㄉ䔉敦䈉偃ऱ〮〰र〮र〮र〮र〮र〮〰र敍獮慵६⸱〰
La tabla sólo tiene 7 registros.
declare @f1 varchar (500)
declare @scrip varchar (2000)
declare @bcpCommand varchar (4000)
Set @f1 = 'D:\ '
Set @scrip = 'SELECT campo1 ,campo2 ……. MAS CAMPOS FROM [BD1].[dbo].
[Tabla1]'
SET @bcpCommand = 'bcp "'+@scrip + '" queryout "'
SET @bcpCommand = @bcpCommand + @f1 + 'mitexto.txt' + '" -U sa -P -c'
EXEC master..xp_cmdshell @bcpCommand
Los campos de la tabla son varchar, char datetime, numérica y poco, y
muchos de ellos admiten valores nulos
Para exportar el texto, hay algo que tenga que configurar? , Algunas
de las opciones
Me pueden ayudar con este problema, voy a agradecer mucho.
Trabajar con SQL Server 2000.
Algo que ver el tamaño de los registros.
*/
- Prev by Date: Exiting a package without putting it on failure
- Next by Date: Sql Server Job security problem
- Previous by thread: Exiting a package without putting it on failure
- Next by thread: Sql Server Job security problem
- Index(es):
Relevant Pages
|