all groups > sql server clients > may 2005 >
You're in the

sql server clients

group:

XML Help


XML Help Joh
5/19/2005 1:22:56 PM
sql server clients:
I am using the following query for fetching the data from the txt file.....
but failed to do so....

select a.* from OpenRowset('MSDASQL', 'Driver={Microsoft Text Driver (*.txt;
*.csv)};
DefaultDir=C:\xml;','select * from Test.txt') as a

Test.txt:-

<ROOT> <Customer CustomerID="VINET" ContactName="Paul Henriot"> <Order
OrderID="10248" CustomerID="VINET" EmployeeID="5"
OrderDate="1996-07-04T00:00:00"> <OrderDetail ProductID="11" Quantity="12"/>
<OrderDetail ProductID="42" Quantity="10"/> </Order> </Customer> <Customer
CustomerID="LILAS" ContactName="Carlos Gonzlez"> <Order OrderID="10283"
CustomerID="LILAS" EmployeeID="3" OrderDate="1996-08-16T00:00:00">
<OrderDetail ProductID="72" Quantity="3"/> </Order> </Customer> </ROOT>

Result:-

<ROOT> <Customer CustomerID=
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
---------------------------
(0 row(s) affected)

Any idea what I have to do now ?

Re: XML Help Vinod Kumar
5/25/2005 12:00:00 AM
What do you want to do. The Select query will dump the contents on your
screen.

--
HTH,
Vinod Kumar
MCSE, DBA, MCAD, MCSD
http://www.extremeexperts.com

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

[quoted text, click to view]

AddThis Social Bookmark Button