Параметр @attach_query_result_as_file не может быть равен 1 (true), если параметр @query не имеет значения. Необходимо указать запрос, чтобы присоединить результаты запроса.
Click to search this error in Google
English version
Parameter @attach_query_result_as_file cannot be 1 (true) when no value is specified for parameter @query. A query must be specified to attach the results of the query.