Tag Archives: sql server

SQL Management Studio Jr.

It’s almost inarguable that Microsoft’s IntelliSense is either the top dog, or in the top three at syntax suggestion/completion. What bothers me is that with standard Visual Studio installs (as recent as VS 2013), you don’t get the full SQL Management Studio package. Instead you have to go download SQL Management Studio Jr., with a severely reduced feature set, from Microsoft. Why should you care?

How many developers of relational database-backed applications are there in 2014 that don’t have to think about database performance or troubleshooting ever?
I hope that answer is close to zero.
Even if you’re fortunate enough to have an experienced database administrator, as a developer it would be in everyone’s best interest if you tried to make their job easier and not harder.

As a developer that’s using Microsoft’s database platform, even if you’re not necessarily using Microsoft’s languages (Python, PHP, Ruby, and Node are all supported on Windows Servers), you should be able to do some simple query plan analysis, reporting, and troubleshooting. Yet, the tools required to do these simple tasks are mysteriously left out of the “free” version of Management Studio.

Have a query that’s running long for no apparent reason? Have fun; you’re on your own – unless of course you have access to a Microsoft SQL Server license key and supporting disk image.
In order to have access to the latest SQL Server Profiler, Integration Tools, and Database Engine Tuning Advisor, you’ll either need a better MSDN account (the MSDN account included with Visual Studio didn’t include SQL Server for me) or a full-on SQL Server license.


Luckily, my workplace has an MSDN account for us and I was able to use that. Had I been on my own, I would’ve been shelling out some serious dollars (SQL Server licensing is hilariously expensive) to have very basic tools that should be bundled with Visual Studio by default.

While some might view Visual Studio as the best IDE currently available, I still believe it has a ways to go in terms of developer friendly enhancements and decoupling from Microsoft as an avenue for revenue and instead using it as an incentive (reduced cost, free, etc.) to bring more developers to their platform. The full version of SQL Server Management Studio is a developer tool and should be included with every Visual Studio install.


How To Install Microsoft SQL Server ODBC Driver for Linux on Ubuntu Server

UPDATE: I’ve included a list of items to consider when connecting to a Microsoft SQL Server from Linux here. Please review this if you’re starting out and don’t fully understand your possibly choices (using your programming language of choice’s driver, using the Microsoft ODBC driver for linux, or possibly using an open-source driver such as freetds).

UPDATE 2: I’ve included a new link to a tutorial I wrote on how to install an updated unixODBC on Ubuntu Server.

Need to connect to a Microsoft SQL Server on Linux? Your best bet is to use their ODBC drivers (available here) – but OH NO – they’re only supported via Red Hat Enterprise Linux.

No fear – of course they’ll work on most 64bit distributions.

Install Instructions for Ubuntu Server 12.10 – this should actually work for most Debian/Ubuntu distributions that have packages available for openssl-1.0.0 and unixODBC 2.3.0 (though you may want to download and install 2.3.2 for better performance):

The following numbered steps have become mostly unnecessary. I’ve fixed the Microsoft scripts so you no longer have to use “–force” to install the driver on Ubuntu and create all the symlinks yourself.
Those fixed scripts are available here: Microsoft SQL Server ODBC Driver 1.0 for Linux Fixed Install Scripts.
To use the modified scripts you can:

To install the driver manually:

  1. Visit http://www.microsoft.com/en-us/download/details.aspx?id=36437 and download the file for “RedHat6\msodbcsql-11.0.2270.0.tar.gz”. Currently you can use the following command until the link changes:
    $ wget http://download.microsoft.com/download/B/C/D/BCDD264C-7517-4B7D-8159-C99FC5535680/RedHat6/msodbcsql-11.0.2270.0.tar.gz
  2. Extract the tarball:  tar -zxvf msodbcsql-11.0.2270.0.tar.gz
  3. Download and Install unixODBC 2.3.0+ if you haven’t already
  4. change to the new directory ( cd sqlncli-11.0.1790.0 ) and run the install script:
    sudo bash install.sh install --accept-license --force
  5. make sure the SQL Server dependencies are installed:
    sudo apt-get install openssl libkrb5-3 libc6 e2fsprogs
  6. Create some symlinks so everything works with the paths these binaries are expecting to find libraries:
    • sudo ln -s /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /usr/lib/x86_64-linux-gnu/libcrypto.so.10;
    • sudo ln -s /lib/x86_64-linux-gnu/libssl.so.1.0.0 /usr/lib/x86_64-linux-gnu/libssl.so.10;
    • sudo ln -s /usr/lib/x86_64-linux-gnu/libodbcinst.so.2.0.0 /usr/lib/x86_64-linux-gnu/libodbcinst.so.1;
    • sudo ln -s /usr/lib/x86_64-linux-gnu/libodbc.so.2.0.0 /usr/lib/x86_64-linux-gnu/libodbc.so.1

And that should be it. The last two steps are dependent on unixODBC-2.3.1 or higher. If you’re using 2.3.0 (please upgrade) you’ll need to link against the “1.0.0” libraries.

Test your install by connecting to your server using sqlcmd (sqlcmd -S my.sql.server.com -U username) to make sure everything is ok. You should now be able to configure ODBC to use the MS SQL ODBC Driver for Linux on Ubuntu.

Yes – in that last steps we’re creating  symlinks from “2.0.0” with a link names “.so.1” – masquerading as the older version 1 doesn’t seem to hurt anything in any of my installations. According to the unixODBC changelog: “Major change is to change the library version number from 1 to 2 to signal the SQLLEN change for 64 land. Should have been done for 2.3.0, but better late than never. So if after installing you have apps that can’t find libodbc.so, its likely they are linked to libodbc.so.1, so just create a symlink from libodbc.so.2”

So I think we’re OK.