def get_db_url_sqlserver(config):
    """
    Helper function for creating the "pyodbc" connection string.

    @see http://docs.sqlalchemy.org/en/latest/dialects/mssql.html
    @see https://code.google.com/p/pyodbc/wiki/ConnectionStrings
    """
    from urllib import parse
    params = parse.quote(
        'Driver={{FreeTDS}};Server={};Port={};Database={};UID={};PWD={};'.
        format(config['DB_HOST'], config['DB_PORT'], config['DB_NAME'],
        config['DB_USER'], config['DB_PASS']))
    return 'mssql+pyodbc:///?odbc_connect={}'.format(params)
