SQL Xml

  • Hello All,

    We've implemented a solution at work which allows users to query SQL Server with xpath statements through HTTP. The beauty of this solution is that a user can enter an xpath statement in IE and provide one or more parameters (provided it complies with the underlying schema). However, with SQLXML 4, it no longer supports the ISAPI filter and as a result, we need to write stored procedures and then expose them as web services. This is all fine and dandy, however, this only works in situations where the parameters and queries are preknown. Does anyone know if it's possible to dynamically build a sql statement with the necessary "where" clause and then build a populated xml doc.

    Thanks in advance.

    Nick

     

     

  • Hi Nick,

    Don't know for sure if this is what you ask for, but you can build your query in a string with the where clause and execute the string(query) with an EXECUTE statement.

    Example:

    DECLARE @STR varchar(255)

    DECLARE @WhereStmt varchar(255)

    SET @WhereStmt='1'

    SET @STR='SELECT * FROM myTable WHERE myID=' + WhereStmt

    EXECUTE(@str)

    Hope this helps..

    Regards

    Trond Lind

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply