Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Import *.Dat file in SQL database Expand / Collapse
Posted Wednesday, April 8, 2009 1:10 AM


Group: General Forum Members
Last Login: Thursday, March 31, 2011 8:10 PM
Points: 14, Visits: 55
[color=green]Dear all,
Please help me,I have a Log.Dat file which is from ArcView software. Inside the Log.Dat file like XML code:


How can I import the fields "Time", "type", "code", "target" ... etc in to SQL database?
Please help.
Post #692801
Posted Wednesday, April 8, 2009 8:59 AM


Group: General Forum Members
Last Login: Tuesday, June 7, 2016 5:15 AM
Points: 2,562, Visits: 2,643
Here is sample for Books online that uses XQuery methods

DECLARE @x xml
-- Replace "!" with " ", as the code formatting eats up the XML
SET @x='!Root>
!row id="1">!name>Larry!/name>!oflw>some text!/oflw>!/row>
!row id="2">!name>moe!/name>!/row>
!row id="3" /!
SELECT T.c.query('.') AS result
FROM @x.nodes('/Root/row') T(c)

SELECT T.c.value('name[1]', 'VARCHAR(100)' ) AS result,
T.c.value('oflw[1]', 'VARCHAR(100)' ) AS result
FROM @x.nodes('/Root/row') T(c)

Replaced the existing XML to non XML


Post #693220
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse