SQL Server根据查询结果,生成XML文件
/*
'bcp' 不是内部或外部命令,也不是可运行的程序?
看看在C:Program FilesMicrosoft SQL Server80ToolsBinn里面有没有bcp.exe这个文件
然后看看path里面加C:Program FilesMicrosoft SQL Server80ToolsBinn这个目录没有.
右键我的电脑--属性--高级--环境变量--在系统变量中找到path--编辑
在变量值的最后加上:
C:Program FilesMicrosoft SQL Server80ToolsBINN
*/
/**********************************************************************
存储过程: P_SaveXML
功能: 生成XML文件
参数: 表名
返回: 指定目录的XML文件
调用方法: 传递中间表TB_TABLECOLUMN_T存在的表名
exec P_ZehuaSavexml 'WQ_STINFO_B,WQ_PHY_D','D:xx.xml'
最后更改日期: 2005-8-17
联系方式: zlp@zehua.com.cn
备注: 根据中间表生成符合标准格式的XML文件
www.knowsky.com
**********************************************************************/
/*
exec P_ZehuaSavexml 'WQ_STINFO_B,WQ_PHY_D','D:xx.xml'
*/
go
create proc P_ZehuaSavexml
@TableCodeS varchar(8000),
@fname varchar(1000)='c: mp.xml' --默认保存的XML文件地址
as
declare @sql nvarchar(200),@sql1 varchar(400)
declare @cnt int,@Table_Name varchar(20)
declare @i int,@TableCode varchar(20)
declare @err int,@src varchar(255),@desc varchar(255)
create table ##t(re nvarchar(4000))
insert ##t
select Re=''
union all select '
set @i=charindex(',',@TableCodeS)
while @i>0
begin
set @TableCode=left(@TableCodeS,@i-1)
set @sql=''
set @sql=N'select @cnt=count(*),@Table_Name=max(Table_Name) from '
set @sql=@sql N'('
set @sql=@sql N'select top 100 percent * from TB_TABLECOLUMN_T where '
set @sql=@sql N'TABLE_CODE=''' @TableCode ''' and COLUMNS_ISKEY=''√'' '
set @sql=@sql N'order by COLUMNS_SORT '
set @sql=@sql N')'

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

WebStorm Mac version
Useful JavaScript development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment
