我有一个XML文件,其中包含我的经理告诉我只从文件中提取SQL查询的SQL查询 [英] I have an XML file which consist of SQL query my manager is telling to extract only SQL query from the file

查看:207
本文介绍了我有一个XML文件,其中包含我的经理告诉我只从文件中提取SQL查询的SQL查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个xml文件,其中包含sql查询,我的经理告诉我只从文件中提取sql查询..

我有数据库和xml文件。

1.是否可以在sql server中导入xml文件(尝试过但失败了)

2.我有一些关键字如#prompt#和when和许多关键字,其中sql显示错误



是否可以从xml文件中仅运行sql查询。



我尝试过:



是否可以在sql server中导入xml文件(尝试但失败)

我试图删除那些#prompt并运行但它显示错误

请帮帮我

i have an xml file which consist of sql query my manager is telling to extract only sql query from the file..
I have database and xml file.
1. Is it possible to import the xml file inside the sql server(tried but failed)
2. i have got some of the keywords like #prompt # and when and many keywords where the sql is showing error

Is it possible to run only sql query from xml file.

What I have tried:

Is it possible to import the xml file inside the sql server(tried but failed)
I tried to remove those #prompt and run but it is showing error
Please help me out

推荐答案

请描述你想要什么。很难知道你的要求是什么。但是,我相信你有一个XML文件,它有一些像下面的SQL查询。



Please be descriptive what you want.Its hardly get to know what is your requirement.But, i believe you have a XML file which has some sql queries like below.

<QUERIES>
    <SQL ID="GetBookings">
    <!-- 
        SELECT BookingID from BOOKING B, BOOKING_STATUS BS
        WHERE B.BOOKINGSTATUSID = BS.BOOKINGSTATUSID
        AND BOOKINGSTATUSBOOKINGSEARCH = 1
        AND BOOKINGDATE >= {0}
    -->
    </SQL>
</QUERIES>





以上代码从以下提供的链接复制。

A很好的例子,我认为这是你需要的解决方案。



用XML编写SQL查询 - 支持密集型方法 [ ^ ]


这篇关于我有一个XML文件,其中包含我的经理告诉我只从文件中提取SQL查询的SQL查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆