Register  Login  
  May 18, 2012  
Forum    
Forum Minimize
 
ForumForumDiscussionsDiscussionsXMLdb XMLdb XMLdb from UDT SourceXMLdb from UDT Source
Previous Previous
 
Next Next
New Post
 11/2/2010 3:59 PM
 

Is it possible to use XMLdb 5.5 to create an XML (specifically for podcasting) using data drawn from the UDT tables (in the same way that SGSV could take data from the flattened UDT and add text around it like SELECT '<a href=link> + SGSV cast + '</a>', I would wrap the appropriate XML tags around the UDT data)?

If so, can it be scripted to re-create the file at some interval?

I already have the necessary format laid out. I just need some way for XMLdb to create an XML with the UDT data in the right places.

Thanks.

New Post
 11/3/2010 4:15 PM
 

The most recent version of SGSV does support XLST based templates. Basically this is the same as the XMLdb with the added features of the filters available.

So, if you have the T-SQL that will flatten the UDT as required ... you can add the "for XML" parameters for use with an XSLT script. At this point you, you can use the script to wrap the data in the Select.

As for re-creating the file on a scheduled bag, this gets difficult as SGSV and XMLdb are expect to be on a page. You can have the page auto-refresh, but a user must navigate to the page.

So, to have a schedule "solution" you will need to develop a DLL that the scheduler can call. This DLL will have to implement the functionality of executing the T-SQL and processing the result with an XSLT script. Doable, but may not be what you are want to tackle.

Hope this helps.
Paul.

New Post
 11/11/2010 4:19 PM
 

The scheduling aside, I know that XMLdb/SGSV can generate XML (even from a XSLT) but can an actual file be created from the select?

I've tried using xp_cmdshell successfully with simple select statements (like the one below), but it doesn't seem to like the kind of multi-step select required to flatten UDT. Actually, I can't really get the XML formed properly from a UDT (sometimes I wish Form & List just used simple columns and rows).

EXEC master..xp_cmdshell'bcp "SELECT TOP 5 * FROM cscs.dbo.employee FOR XML PATH (''e''), ROOT(''emp'')" queryout "c:\text.xml" -c -T -x'

Thanks.

Previous Previous
 
Next Next
ForumForumDiscussionsDiscussionsXMLdb XMLdb XMLdb from UDT SourceXMLdb from UDT Source

Print  

  Home | Blog | Forum | Subscriptions | Free Modules | Videos   Page generated in 0.0939828 seconds.
  Copyright 2010 by TressleWorks   Terms Of Use | Privacy Statement