Гость
Форумы / Microsoft SQL Server [игнор отключен] [закрыт для гостей] / Почему не работает insert into xp_cmdshell sp_replmonitorhelppublication ? / 3 сообщений из 3, страница 1 из 1
25.02.2021, 09:31
    #40048594
teCa
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Почему не работает insert into xp_cmdshell sp_replmonitorhelppublication ?
Код: sql
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
declare @TmpTable table  (
publisher_db	varchar(128),--db_Buk
publication	varchar(128),-- db_boo
publication_id	int,-- 2
publication_type	int,-- 0
[status]	int,-- 4
warning	int,-- 2-
worst_latency	int,--  NULL
best_latency	int,-- NULL
average_latency	int,-- NULL
last_distsync	datetime,-- 2021-02-25 09:12:12.163
[retention]	int,-- 72
latencythreshold	int,-- 30
expirationthreshold	int,--  80
agentnotrunningthreshold	int,-- NULL
subscriptioncount	int,-- 1
runningdistagentcount	int,-- 0
snapshot_agentname	varchar(500),-- SRVSQLNKC-db_Buk-db_book-2
logreader_agentname	varchar(500),-- SRVSQLNKC-db_Buk-2
qreader_agentname	varchar(100),-- NULL
worst_runspeedPerf	int,-- NULL
best_runspeedPerf	int,-- NULL
average_runspeedPerf	int,-- NULL
retention_period_unit	int,-- NULL
publisher	varchar(500) -- SRVSQLNKC
);
insert into @TmpTable
exec master..xp_cmdshell ' sqlcmd -E -q "use distribution exec sp_replmonitorhelppublication" -h -1 -W'



авторColumn name or number of supplied values does not match table definition.

Всем привет. Проверил соответствие возвращаемых результатов и столбцов в таблице, всё сходится, но сервер не считает иначе. Подскажите, в чем может быть проблема?

Хочу отлавливать ошибки в репликациях заббиксом, если есть проверенные решения, то поделитесь своим опытом.
...
Рейтинг: 0 / 0
25.02.2021, 09:34
    #40048596
teCa
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Почему не работает insert into xp_cmdshell sp_replmonitorhelppublication ?
teCa,

Кажется понимаю:

авторexec master..xp_cmdshell ' sqlcmd -E -q "use distribution exec sp_replmonitorhelppublication" -h -1 -W'

видимо возвращает значения одним полем, а не таблицей. Как можно это исправить?
...
Рейтинг: 0 / 0
25.02.2021, 09:44
    #40048603
teCa
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Почему не работает insert into xp_cmdshell sp_replmonitorhelppublication ?
teCa,

Сделал через распределённый запрос.
...
Рейтинг: 0 / 0
Форумы / Microsoft SQL Server [игнор отключен] [закрыт для гостей] / Почему не работает insert into xp_cmdshell sp_replmonitorhelppublication ? / 3 сообщений из 3, страница 1 из 1
Целевая тема:
Создать новую тему:
Автор:
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]