Red Gate forums :: View topic - Creating Data for a CML field
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Data Generator 1
SQL Data Generator 1 forum

Creating Data for a CML field

Search in SQL Data Generator 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message
rockinder



Joined: 31 Aug 2009
Posts: 4

PostPosted: Thu Oct 07, 2010 10:09 pm    Post subject: Creating Data for a CML field Reply with quote

I have a table with one column as XMl. this XML contains say student data. Is there a way to create data specific to a XML that I need. Say using a XSD.
the data is like
<XML><name>abc</name><Address>nmnnnn333</Address>....</XML>

Want to create say 10k different XMLs in the same structure. is it possible.
Back to top
View user's profile Send private message
CraigOttley



Joined: 15 Jul 2010
Posts: 13
Location: Newport Pagnell

PostPosted: Fri Dec 17, 2010 1:31 pm    Post subject: Reply with quote

Hi Rockinder,

I've had this problem in the past, If I remember rightly there's no easy way of doing this through SQL Data Generator.

One thing you could try is using the FOR XML clause from flat tables. I think you have to have certain options set on the table and database level for this to work.

This work for me on Adventure works using the Person.Contact table and the AdditionalContactInfo column... (Takes a few seconds for the screen to refresh)

Code:
SELECT TOP 1
        NameStyle ,
        Title ,
        FirstName ,
        MiddleName ,
        LastName ,
        Suffix ,
        EmailAddress ,
        EmailPromotion ,
        Phone ,
        PasswordHash ,
        PasswordSalt
FROM    Person.Contact
ORDER BY NEWID()
FOR     XML PATH('Contact') ,
            ROOT('Person')


Make sure you have Loop until number... Ticked.

HTH
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group