powered by simpleCommunicator - 2.0.52     © 2025 Programmizd 02
Форумы / Microsoft SQL Server [игнор отключен] [закрыт для гостей] / Почему не работает insert into xp_cmdshell sp_replmonitorhelppublication ?
3 сообщений из 3, страница 1 из 1
Почему не работает insert into xp_cmdshell sp_replmonitorhelppublication ?
    #40048594
teCa
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Код: 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
Почему не работает insert into xp_cmdshell sp_replmonitorhelppublication ?
    #40048596
teCa
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
teCa,

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

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

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

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


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