locked
Retrieving the "File Attribute" contents RRS feed

  • Question

  • I've added a logo PNG file in a file attribute - How do I retrieve the contents ?

    Is there a way to move the image to a blob column in SQL Server ? Or do I need to write .NET code ?

    Many thanks,

    Jason


    MCITP BI Developer - MCTS SQL Server (http://bichopsuey.wordpress.com/)

    Tuesday, March 17, 2015 7:00 AM

Answers

  • I am surprised it is exposed id instead of content. I will file a bug.
    At this moment, you have to inner join [tblFile] to access the content.

    Wednesday, March 18, 2015 7:58 PM

All replies

  • Please check for storing image

    http://www.databasejournal.com/features/mssql/article.php/3724556/Storing-Images-and-BLOB-files-in-SQL-Server-Part-2.htm

    http://blog.jerrynixon.com/2008/03/cast-sql-2005-image-data-type-to-xml.html
    • Edited by dave_gona Tuesday, March 17, 2015 7:44 AM
    Tuesday, March 17, 2015 7:34 AM
  • Hi Dave

    I don't need to know how to do it in the SQL Server engine, but in MDS.

    The subscription view exposes an integer value instead of a blob, how do we use this integer to reference the blob.

    Is there an MDS function that might be used? Or an easier method.


    MCITP BI Developer - MCTS SQL Server (http://bichopsuey.wordpress.com/)

    Tuesday, March 17, 2015 8:32 AM
  • That integer is varbinary which is the binary content of the file.

    Search "varbinary to file", you can find different way to dump it into file.

    For example, http://madhuottapalam.blogspot.com/2008/08/creating-files-from-images-stored-in.html

    Tuesday, March 17, 2015 6:26 PM
  • How is the varbinary column referenced? 

    An sp_columns on the subscription view gives me an INT. :


    MCITP BI Developer - MCTS SQL Server (http://bichopsuey.wordpress.com/)

    Wednesday, March 18, 2015 7:10 AM
  • I am surprised it is exposed id instead of content. I will file a bug.
    At this moment, you have to inner join [tblFile] to access the content.

    Wednesday, March 18, 2015 7:58 PM
  • Thanks Vincent !

    This is exactly what I was looking for.


    MCITP BI Developer - MCTS SQL Server (http://bichopsuey.wordpress.com/)

    Friday, March 20, 2015 6:28 AM