def METHOD_NAME(self, cursor):
    if self._settings_query:
        return self._settings_query
    available_columns = self._get_available_settings_columns(cursor, SQL_SERVER_SETTINGS_COLUMNS)
    formatted_columns = []
    for column in available_columns:
        if column in SQL_COLS_CAST_TYPE:
            formatted_columns.append(f"CAST({column} AS {SQL_COLS_CAST_TYPE[column]}) AS {column}")
        else:
            formatted_columns.append(column)
    self._settings_query = SETTINGS_QUERY.format(
        columns=', '.join(formatted_columns),
    )
    return self._settings_query