{"id":1770,"date":"2020-01-31T13:53:57","date_gmt":"2020-01-31T20:53:57","guid":{"rendered":"http:\/\/jim-zimmerman.com\/?p=1770"},"modified":"2020-01-31T13:53:57","modified_gmt":"2020-01-31T20:53:57","slug":"query-microsoft-sql-from-centos7","status":"publish","type":"post","link":"https:\/\/jim-zimmerman.com\/?p=1770","title":{"rendered":"Query Microsoft SQL from CentOS7"},"content":{"rendered":"<p>Install the Microsoft repository into your yum configuration:<\/p>\n<blockquote><p># curl https:\/\/packages.microsoft.com\/config\/rhel\/7\/prod.repo > \/etc\/yum.repos.d\/mssql-release.repo<\/p><\/blockquote>\n<p>Disable the repository:<\/p>\n<blockquote><p>vi \/etc\/yum.repos.d\/mssql-release.repo<br \/>\n&#8230;<br \/>\nenabled=0<br \/>\n&#8230;<\/p><\/blockquote>\n<p>Remove the unixODBC packages if applicable:<\/p>\n<blockquote><p># yum remove unixODBC-utf16 unixODBC-utf16-devel<\/p><\/blockquote>\n<p>Install the driver and command line tools (if wanted):<\/p>\n<blockquote><p># yum &#8211;enablerepo packages-microsoft-com-prod install msodbcsql17<br \/>\n# yum &#8211;enablerepo packages-microsoft-com-prod install mssql-tools<\/p><\/blockquote>\n<p>Add the tools directory to your PATH variable as required:<\/p>\n<blockquote><p>vi ~\/.bash_profile ~\/.bashrc<br \/>\n&#8230;<br \/>\nexport PATH=&#8221;$PATH:\/opt\/mssql-tools\/bin&#8221;<br \/>\n..<\/p><\/blockquote>\n<p>Add the tools to your current session:<\/p>\n<blockquote><p>export PATH=&#8221;$PATH:\/opt\/mssql-tools\/bin&#8221;<\/p><\/blockquote>\n<p>Test with sqlcmd:<\/p>\n<blockquote><p>sqlcmd -U <em>username<\/em> -P <em>password<\/em> -S <em>server<\/em> -d <em>database<\/em><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Install the Microsoft repository into your yum configuration: # curl https:\/\/packages.microsoft.com\/config\/rhel\/7\/prod.repo > \/etc\/yum.repos.d\/mssql-release.repo Disable the repository: vi \/etc\/yum.repos.d\/mssql-release.repo &#8230; enabled=0 &#8230; Remove the unixODBC packages if applicable: # yum remove unixODBC-utf16 unixODBC-utf16-devel Install the driver and command line tools (if wanted): # yum &#8211;enablerepo packages-microsoft-com-prod install msodbcsql17 # yum &#8211;enablerepo packages-microsoft-com-prod install mssql-tools Add the [&#038;hellip<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[48,218,489],"class_list":["post-1770","post","type-post","status-publish","format-standard","hentry","category-documentation","tag-linux","tag-mssql","tag-odbc"],"share_on_mastodon":{"url":"","error":""},"_links":{"self":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1770","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1770"}],"version-history":[{"count":4,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1770\/revisions"}],"predecessor-version":[{"id":1775,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1770\/revisions\/1775"}],"wp:attachment":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1770"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1770"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1770"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}