SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Import *.Dat file in SQL database


Import *.Dat file in SQL database

Author
Message
yoothasak1
yoothasak1
SSC-Enthusiastic
SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)

Group: General Forum Members
Points: 106 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:





[/color]

How can I import the fields "Time", "type", "code", "target" ... etc in to SQL database?
Please help.
Ramesh Saive
Ramesh Saive
SSCertifiable
SSCertifiable (6.6K reputation)SSCertifiable (6.6K reputation)SSCertifiable (6.6K reputation)SSCertifiable (6.6K reputation)SSCertifiable (6.6K reputation)SSCertifiable (6.6K reputation)SSCertifiable (6.6K reputation)SSCertifiable (6.6K reputation)

Group: General Forum Members
Points: 6582 Visits: 2643
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" /!
!/Root>'
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)



Edit:
Replaced the existing XML to non XML

--Ramesh


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search