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?