Cambiar formato de salida de la info al utilizar Microsoft.ACE.OLEDB.12.0

MAURICIO UEZ 20 Reputation points
2023-04-28T12:11:58.8866667+00:00
Hola consulto si me puede brindar alguna solución, necesito exportar una consulta de sql a un archivo de texto, (eso lo genero sin problemas) pero necesito cambiar el formato con el que me guarda la info en el archivo de texto.

*En el Sql  utilizo

INSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0','Text;Database=C:\PadronExcel\Csv\;HDR=YES;FMT=Delimited(;)','SELECT * FROM test.txt')
SELECT top 20 object_id, name
  FROM sys.tables;

y la info en el archivo de texto me sale de esta manera, necesito que me exporte sin comillas dobles y separado con ;. 

*Archivo txt

object_id, name

"6616158","Inmunios"
"8660120","Nomenclador"
"16055143","Re"
"18984040","Socios"
"20364033","Inmu"
SQL Server | Other
{count} votes

Accepted answer
  1. Erland Sommarskog 121.9K Reputation points MVP Volunteer Moderator
    2023-04-28T20:58:10.57+00:00

    La lengua de ese forum es inglese.

    If you go by the INSERT OPENROWSET route, you are quite much in a straightjacket, I think. You get what you get.

    I think you should use BCP instead which offers more degrees of freedom.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.