Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 653913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:26:08+00:00 2026-05-13T22:26:08+00:00

It seems that SQL Server has a fair amount of XML support. Mostly I’ve

  • 0

It seems that SQL Server has a fair amount of XML support. Mostly I’ve seen info regarding storing XML in SQL Server, querying XML data stored in SQL Server, and exposing data as XML.

Is the following scenario an option:

I’d like to expose xml data (it’s an RSS view of workitems) from a web site via a SQL Server view. The motivation is to create new computed values and then show the data via an SSRS report.

I’d like to use a view so that the data is always live, and avoid the need for a batch ETL.

Is this possible? What does the syntax look like?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T22:26:09+00:00Added an answer on May 13, 2026 at 10:26 pm
    using System;
    using System.Data.Sql;
    using Microsoft.SqlServer.Server;
    using System.Collections;
    using System.Data.SqlTypes;
    using System.Diagnostics;
    using System.IO;
    using System.Net;
    using System.Runtime.InteropServices;
    
    using System.Xml;
    
    namespace RSSFunctions
    {
        public class GetRSSFeedClass
        {
            private class RSSRow
            {
                public SqlString Title;
                public SqlString Description;
    
                public RSSRow(SqlString Title, SqlString Description)
                {
                    this.Title = Title;
                    this.Description = Description;
                }
            }
    
            [SqlFunction(FillRowMethodName = "FillRSSRow")]
            public static IEnumerable GetRSSFeed(SqlString RSSurl)
            {
                ArrayList RSSRowsCollection = new ArrayList();
                string url = RSSurl.ToString();
                WebRequest req = System.Net.WebRequest.Create(url);
                WebResponse Res = req.GetResponse();
    
                Stream rssStream = Res.GetResponseStream();
                XmlDocument rssDoc = new XmlDocument();
                rssDoc.Load(rssStream);
    
                XmlNodeList rssItems = rssDoc.SelectNodes("rss/channel/item");
    
                String Title = "";
                String Description = "";
                int i = 0;
    
                for (i = 0; i <= rssItems.Count - 1; i++)
                {
                    XmlNode rssDetail = default(XmlNode);
    
                    Title = "";
                    rssDetail = rssItems.Item(i).SelectSingleNode("title");
                    if (rssDetail.Equals(null) == false)
                    {
                        Title = rssDetail.InnerText;
                    }
    
                    Description = "";
                    rssDetail = rssItems.Item(i).SelectSingleNode("description");
                    if (rssDetail.Equals(null) == false)
                    {
                        Description = rssDetail.InnerText;
                    }
    
                    if (Title.Length > 97)
                    {
                        Title = Title.Substring(0, 97) + "...";
                    }
    
                    if (Description.Length > 3997)
                    {
                        Description = Description.Substring(0, 3997) + "...";
                    }
    
                    if (!string.IsNullOrEmpty(Title) && !string.IsNullOrEmpty(Description))
                    {
                        RSSRowsCollection.Add(new RSSRow(new SqlString(Title), new SqlString(Description)));
    
                    }
                }
    
                return RSSRowsCollection;
            }
    
            public static void FillRSSRow(object obj, out SqlString Title, out SqlString Description)
            {
                RSSRow _RSSRow = (RSSRow)obj;
                Title = _RSSRow.Title;
                Description = _RSSRow.Description;
            }
    

    SSMS

    --ALTER DATABASE [dbname] TRUSTWORTHY ON
    --go
    
    IF EXISTS (SELECT name FROM sysobjects WHERE name = 'RSSData')
       DROP VIEW RSSData
    go
    
    IF EXISTS (SELECT name FROM sysobjects WHERE name = 'fncCLRGetRSSFeed')
       DROP FUNCTION fncCLRGetRSSFeed
    go
    
    IF EXISTS (SELECT name FROM sys.assemblies WHERE name = 'CLRRSSAssembly')
       DROP ASSEMBLY CLRRSSAssembly
    go
    CREATE ASSEMBLY CLRRSSAssembly FROM 'C:\RSSAssembly.dll'
    WITH PERMISSION_SET = EXTERNAL_ACCESS
    GO
    
    CREATE FUNCTION fncCLRGetRSSFeed(@url nvarchar(100)) 
    RETURNS TABLE (
       Title nvarchar(100),
       [Description] nvarchar(4000)
    )
    AS EXTERNAL NAME CLRRSSAssembly.[RSSFunctions.GetRSSFeedClass].GetRSSFeed
    go
    
    CREATE VIEW RSSData
    AS
    SELECT * FROM fncCLRGetRSSFeed(N'http://channel9.msdn.com/Feeds/RSS/')
    go
    
    SELECT * FROM RSSData
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 450k
  • Answers 450k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer What you need to do is create an .htaccess file… May 15, 2026 at 8:24 pm
  • Editorial Team
    Editorial Team added an answer Here you go #!/usr/bin/env perl open (IMPORT, "import.txt") || die… May 15, 2026 at 8:24 pm
  • Editorial Team
    Editorial Team added an answer Try this (updated): grep -HlZ 'author="[^"].*' -- *.xml | xargs… May 15, 2026 at 8:24 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.