{"id":1020,"date":"2020-10-06T11:41:36","date_gmt":"2020-10-06T03:41:36","guid":{"rendered":"https:\/\/www.yohz.com\/blogs\/?p=1020"},"modified":"2022-07-07T09:09:18","modified_gmt":"2022-07-07T01:09:18","slug":"how-to-view-image-data-type-in-sql-server","status":"publish","type":"post","link":"https:\/\/www.yohz.com\/blogs\/2020\/10\/06\/how-to-view-image-data-type-in-sql-server\/","title":{"rendered":"How to view image data type in SQL Server"},"content":{"rendered":"<p>The image data type in SQL Server is frequently used to store variable length binary data.\u00a0 It does not have to store only &#8216;images&#8217;, though most people associate that data type with images.<\/p>\n<p>You may occasionally need to view the type of data that&#8217;s stored, but SQL Server Management Studio can only display the binary representation of the data (we&#8217;re using the AdventureWorks sample database here).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1021\" src=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_01.png\" alt=\"\" width=\"870\" height=\"295\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_01.png 870w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_01-300x102.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_01-768x260.png 768w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_01-624x212.png 624w\" sizes=\"(max-width: 870px) 100vw, 870px\" \/><\/p>\n<p><a href=\"https:\/\/www.yohz.com\/siv8_details.htm\">SQL Image Viewer<\/a> is one tool that can display the image directly in the result set.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1022\" src=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_02.png\" alt=\"\" width=\"794\" height=\"554\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_02.png 794w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_02-300x209.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_02-768x536.png 768w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_02-624x435.png 624w\" sizes=\"(max-width: 794px) 100vw, 794px\" \/><\/p>\n<p>Interesting points to note:<\/p>\n<ul>\n<li>the image format was never provided.\u00a0 <a href=\"https:\/\/www.yohz.com\/siv8_details.htm\">SQL Image Viewer<\/a> can read the binary data and determine the image format itself.\u00a0 It recognizes png, gif, jpg, tiff, bmp, wmf, emf, dicom, and raw camera formats.<\/li>\n<li>details of the image like size and resolution are provided automatically<\/li>\n<\/ul>\n<p>Though its name might suggest otherwise, <a href=\"https:\/\/www.yohz.com\/siv8_details.htm\">SQL Image Viewer<\/a> doesn&#8217;t just support &#8216;images&#8217;.\u00a0 It recognizes a wide variety of file formats, including <span class=\"xr_tl xr_s19\">Microsoft Office documents, <\/span><span class=\"xr_tl xr_s19\">OpenOffice documents, <\/span><span class=\"xr_tl xr_s19\">PDF, epub, multimedia files (<\/span><span class=\"xr_tl xr_s19\">avi, wav, mp3, mp4, svg, swf, flv, mkv, webm, m4v, mov, 3gp), and compressed archives (<\/span><span class=\"xr_tl xr_s19\">zip, 7zip, rar, bzip2, gzip).<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1023\" src=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_03.png\" alt=\"\" width=\"474\" height=\"834\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_03.png 474w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_03-171x300.png 171w\" sizes=\"(max-width: 474px) 100vw, 474px\" \/><\/p>\n<p>For PDFs, <a href=\"https:\/\/www.yohz.com\/siv8_details.htm\">SQL Image Viewer<\/a> is able to display a thumbnail of the first page, and also the number of pages in the file.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1028\" src=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_08.png\" alt=\"\" width=\"525\" height=\"584\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_08.png 525w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_08-270x300.png 270w\" sizes=\"(max-width: 525px) 100vw, 525px\" \/><\/p>\n<p>Once retrieved, you can export the binary data.\u00a0 You can export them to a spreadsheet:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1024\" src=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_04.png\" alt=\"\" width=\"563\" height=\"1022\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_04.png 563w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_04-165x300.png 165w\" sizes=\"(max-width: 563px) 100vw, 563px\" \/><\/p>\n<p>or simply export them as individual files:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1025\" src=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_05.png\" alt=\"\" width=\"532\" height=\"604\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_05.png 532w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_05-264x300.png 264w\" sizes=\"(max-width: 532px) 100vw, 532px\" \/><\/p>\n<p>You can name the files using values from other columns.\u00a0 You can also convert the exported images to other formats:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1026\" src=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_06.png\" alt=\"\" width=\"557\" height=\"291\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_06.png 557w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_06-300x157.png 300w\" sizes=\"(max-width: 557px) 100vw, 557px\" \/><\/p>\n<p>For images that contain EXIF values, you can view these values using the internal viewer:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1027\" src=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_07.png\" alt=\"\" width=\"805\" height=\"552\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_07.png 805w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_07-300x206.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_07-768x527.png 768w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_07-624x428.png 624w\" sizes=\"(max-width: 805px) 100vw, 805px\" \/><\/p>\n<p>In addition to SQL Server,\u00a0<a href=\"https:\/\/www.yohz.com\/siv8_details.htm\">SQL Image Viewer<\/a> also supports Oracle, PostgreSQL, MySQL, MariaDB, Microsoft Access, SQLite, Firebird\/Interbase and ODBC supported databases.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1029\" src=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_09.png\" alt=\"\" width=\"426\" height=\"541\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_09.png 426w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/10\/imagedatatype_09-236x300.png 236w\" sizes=\"(max-width: 426px) 100vw, 426px\" \/><\/p>\n<p>Thus, you can easily view the data that&#8217;s stored in<\/p>\n<ul>\n<li>binary and varbinary columns in Oracle databases<\/li>\n<li>bytea columns in PostgreSQL databases<\/li>\n<li>binary and varbinary columns in MySQL and MariaDB databases<\/li>\n<li>binary and varbinary columns in Microsoft Access databases<\/li>\n<li>OLE-Object columns in Microsoft Access databases<\/li>\n<\/ul>\n<p>Download a <a href=\"http:\/\/www.yohz.com\/downloads\/sqlblobviewer\/SQLImageViewerSetup.zip\">free 14-day trial<\/a> now and see how <a href=\"https:\/\/www.yohz.com\/siv8_details.htm\">SQL Image Viewer<\/a> can make working with image data types in SQL Server so much easier.<\/p>\n<p>If writing SQL scripts is not your thing, <a href=\"https:\/\/www.yohz.com\/sbe_details.htm\">SQL Blob Export<\/a> is a wizard-driven alternative to SQL Image Viewer.<\/p>\n<div class=\"fcbkbttn_buttons_block\" id=\"fcbkbttn_left\"><div class=\"fcbkbttn_like \"><fb:like href=\"https:\/\/www.yohz.com\/blogs\/2020\/10\/06\/how-to-view-image-data-type-in-sql-server\/\" action=\"like\" colorscheme=\"light\" layout=\"button\"  size=\"small\"><\/fb:like><\/div><div class=\"fb-share-button  \" data-href=\"https:\/\/www.yohz.com\/blogs\/2020\/10\/06\/how-to-view-image-data-type-in-sql-server\/\" data-type=\"button\" data-size=\"small\"><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>The image data type in SQL Server is frequently used to store variable length binary data.\u00a0 It does not have to store only &#8216;images&#8217;, though most people associate that data type with images. You may occasionally need to view the type of data that&#8217;s stored, but SQL Server Management Studio can only display the binary [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[5,11],"tags":[178,12,176,177],"_links":{"self":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts\/1020"}],"collection":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/comments?post=1020"}],"version-history":[{"count":3,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts\/1020\/revisions"}],"predecessor-version":[{"id":1741,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts\/1020\/revisions\/1741"}],"wp:attachment":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/media?parent=1020"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/categories?post=1020"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/tags?post=1020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}