Have you tried to use SSIS (SQL Server Integration Services), it have a bunch of predefined tasks that you can use, furthermore you may want some data transformation..
If you prefer not to use SSIS this script may give you an idea:
(it creates a sample table with one column of xml datatype in populate it from other table that stores xml data, the key is using insert into tablename SELECT ...)
USE AdventureWorks
GO
CREATE TABLE dbo.SampleXMLTable
(
XMLData xml NULL
) ON [PRIMARY]
GO
INSERT INTO dbo.SampleXMLTable
SELECT AdditionalContactInfo FROM Person.Contact
WHERE AdditionalContactInfo IS NOT NULL
GO
SELECT * FROM dbo.SampleXMLTable
Best regards,
Marko Jagodic,
Pexim Solutions, Serbia
|