<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>neko3cs</author_name>
  <author_url>https://blog.hatena.ne.jp/neko3cs/</author_url>
  <blog_title>ねこさんのぶろぐ</blog_title>
  <blog_url>https://blog.neko3cs.net/</blog_url>
  <categories>
    <anon>PowerShell</anon>
    <anon>PowerShell Core</anon>
    <anon>SQL Server</anon>
  </categories>
  <description>今回は PowerShell を使って SQL Server に保存された varbinary 型のデータを取得してファイル保存する方法を紹介します。 私の担当システムでは画像を扱っており、SQL Server のデータベースに varbinary 型で保存するようにしてます。 これを時々何が入っているのか確認したくなるのですが、一々C#でアプリ作って確認するのは手間ですよね？ PowerShellでサクッと出来ないかなと調べたら意外と単純だったのでここに記載します。 やりかた 以下のコマンドで行けます。 Invoke-Sqlcmd ` -ServerInstance &quot;localhost&quot; …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.neko3cs.net%2Fentry%2Fhow-to-get-binary-from-sqlserver-using-pwsh&quot; title=&quot;SQL Server の varbinary 型データを PowerShell で取得して保存する - ねこさんのぶろぐ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-09-10 17:54:54</published>
  <title>SQL Server の varbinary 型データを PowerShell で取得して保存する</title>
  <type>rich</type>
  <url>https://blog.neko3cs.net/entry/how-to-get-binary-from-sqlserver-using-pwsh</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
