SQL:  RDL Read::

Posted on 2012-09-02
Last Modified: 2012-10-26
Hello team,
How easy is to read an RDL file into an SQL table of choice?
I have over couple of hundred RDLs and I need to read the fields/values into a new table in SQL.. for further processings.

I know how to read an xml file into an sql table but having a bit of a difficulty with this critter.
any assistance will be apprecited.

Question by:John Esraelo
    1 Comment

    Accepted Solution

    I have seen the following code in expert-exchange but it does not work for me.. not sure where I am missing certain pieces..
    DECLARE @xml XML
    SELECT @xml = BulkColumn 
    FROM OPENROWSET(BULK 'C:\Bulk\Test Report.rdl', SINGLE_BLOB) AS x  
    SELECT @xml;
    	r.value('../../../../DataSources[1]/DataSource[1]/@Name','varchar(100)') AS DataSourceName,
    	r.value('../../../../DataSources[1]/DataSource[1]/DataSourceReference[1]','varchar(10)') AS DataSourceReference,
    	r.value('../../@Name','varchar(100)') AS DataSetName,
    	r.value('@Name','varchar(100)') AS FiledName,
    	r.value('../../Query[1]/CommandText[1]','varchar(max)') AS CommandText
    --FROM @xml.nodes('Report/DataSets/DataSet/Fields/Field') AS doc(r)
    FROM @xml.nodes('//Field') AS doc(r)

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
    The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
    Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
    Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now