Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/opengl/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 调用sqlcmd-使用powershell将sql查询的输出导出到xml文件_Sql Server_Xml_Powershell_For Xml - Fatal编程技术网

Sql server 调用sqlcmd-使用powershell将sql查询的输出导出到xml文件

Sql server 调用sqlcmd-使用powershell将sql查询的输出导出到xml文件,sql-server,xml,powershell,for-xml,Sql Server,Xml,Powershell,For Xml,我有一个带有FORXML explicit子句的sql查询。结果我需要存储在一个xml文件中。 我正在使用powershell命令执行此操作: 调用sqlcmd-inputFile$inputFilePath | Out File-filePath$outputFilePath 这给了我一个类似于的输出文件 XML_F52E2B61-18A1-11d1B1000805F49916B “您是否尝试过导出Clixml而不是输出文件 invoke-sqlcmd -inputFile $inputFi

我有一个带有FORXML explicit子句的sql查询。结果我需要存储在一个xml文件中。 我正在使用powershell命令执行此操作: 调用sqlcmd-inputFile$inputFilePath | Out File-filePath$outputFilePath

这给了我一个类似于的输出文件

XML_F52E2B61-18A1-11d1B1000805F49916B
“您是否尝试过导出Clixml而不是输出文件

 invoke-sqlcmd -inputFile $inputFilePath | Export-Clixml -filePath $outputFilePath

查询是输出XML还是常规数据表?