Results 1 to 3 of 3

Thread: please, i need help

  1. #1
    Join Date
    Jun 2013
    Posts
    5

    please, i need help

    I have been working on how to shred xml on my sql 2008 sever. After writing my query as follows: DECLARE @hdoc int
    DECLARE @doc varchar(1000)
    SET @doc ='
    <ROOT>
    <Customer CustomerID="VINET" ContactName="Paul H
    <Order CustomerID="VINET" EmployeeID="5" Orde
    <OrderDetail OrderID="10248" ProductID="11
    <OrderDetail OrderID="10248" ProductID="42
    </Order>
    </Customer>
    <Customer CustomerID="LILAS" ContactName="Carlos
    <Order CustomerID="LILAS" EmployeeID="3" Orde
    <OrderDetail OrderID="10283" ProductID="72
    </Order>
    </Customer>
    </ROOT>' then i want to --Create an internal representation of the XML by
    EXEC sp_xml_preparedocument @hdoc OUTPUT, @doc
    i will get the following error message: Must declare the scalar variable '@hdoc'

    please, what do i do to successfully execute the above query?

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    You have only declared @doc, not @hdoc.

  3. #3
    Join Date
    Jun 2013
    Posts
    5
    Quote Originally Posted by skhanal View Post
    You have only declared @doc, not @hdoc.
    sorry, i declared @hdoc not @doc.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •