'MS-SQL puts TOP, it\'s version of LIMIT here'

def get_select_precolumns(self, select):

    if (select._distinct or (select._limit is not None)):
        s = ((select._distinct and 'DISTINCT    ') or '')
        if (select._limit is not None):
            if (not select._offset):
                s += ('TOP    %d    ' % select._limit)
        return s
    return compiler.SQLCompiler.get_select_precolumns(self, select)
