Click here to Skip to main content
15,885,032 members
Articles / Desktop Programming / Windows Forms

Transferring Data from a Single XML Stream into Multiple Tables with One Forward-Only Read

Rate me:
Please Sign up or sign in to vote.
4.75/5 (12 votes)
30 Sep 2011CPOL13 min read 43K   763   32  
Using parallel implementations of SqlBulkCopy to achieve fast data transfer from a single XML source into multiple tables.
CREATE TABLE [dbo].[TxcRoute](
	[RouteID] [nvarchar](15) NOT NULL,
	[PrivateCode] [nvarchar](15) NOT NULL,
	[Description] [nvarchar](255) NOT NULL,
	[RouteSectionRef] [nvarchar](20) NOT NULL,
 CONSTRAINT [PK_TxcRoute] PRIMARY KEY CLUSTERED 
(
	[RouteID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

CREATE TABLE [dbo].[TxcRouteLink](
	[RouteLinkID] [nvarchar](20) NOT NULL,
	[RouteSectionRef] [nvarchar](20) NOT NULL,
	[FromID] [nvarchar](13) NOT NULL,
	[ToID] [nvarchar](13) NOT NULL,
	[Direction] [nvarchar](1) NOT NULL,
 CONSTRAINT [PK_TxcRouteLink] PRIMARY KEY CLUSTERED 
(
	[RouteLinkID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) SpiegelSoft
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions