Michael Rys

Musings on XML, XQuery and more...

<July 2008>
SuMoTuWeThFrSa
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789


Navigation

Papers

SQL Server XML Whitepapers

Weblogging Links

MS Bloggers

Recommended Books

Other Blogs

Recommended Links

Presentations (Upcoming)

Presentations (Recent)

Subscriptions

News


Upcoming Presentations


TechEd 2007, Orlando, June 4 to June 8, 2007


Books I co-authored



www.flickr.com
This is a Flickr badge showing public photos from Michael Rys. Make your own badge here.
eXTReMe Tracker

Post Categories

Article Categories



MSDN WebCast Demo: Loading XML data

-- Loading
-- Execute every statement in the sample in order
-- Set filenames in loading steps to correct locations
-- (c) 2004, 2005 Microsoft Corp.

use master
USE msdn2005
GO

--Create simple table containing XML column
IF EXISTS (SELECT * FROM sys.tables WHERE name = 'XMLdoc')
 
DROP TABLE XMLdoc
GO

CREATE TABLE XMLdoc (id INT identity primary key, doc XML )
GO

-- Insert XML document
INSERT INTO XMLdoc (doc)

SELECT *
FROM OPENROWSET (BULK 'insert your path here\Customer1.xml',
        
SINGLE_BLOB) AS TEMP
GO

-- Insert XML fragment
INSERT INTO XMLdoc (doc)
SELECT *
FROM OPENROWSET (BULK 'Insert your path here\Customer2.xml',
       
SINGLE_BLOB) AS TEMP
GO

-- Insert a string
INSERT INTO XMLdoc(doc) VALUES (N'<doc/>')
go

-- Take a look at the XML
SELECT * FROM XMLdoc
GO

posted on Tuesday, April 12, 2005 12:01 PM by mrys





Powered by Dot Net Junkies, by Telligent Systems