powered by simpleCommunicator - 2.0.59     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Microsoft SQL Server [игнор отключен] [закрыт для гостей] / Cannot use text/ntext/image columns in the inserted and deleted tables
3 сообщений из 3, страница 1 из 1
Cannot use text/ntext/image columns in the inserted and deleted tables
    #32014619
Miha
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Привет All

Есть код типа:

create trigger U_HIST_Accessor on Accessor
for update
as
select * into #tt_deleted from deleted
select * into #tt_inserted from inserted
.....

Естественно
он не работает, ошибка - см. сабж.
Кто-нибудь знает, какого черта ОН (МССКУЭЛ) создает таблицы deleted и inserted с полями,
типы которых не поддерживает?
Можно как-то определить изменение поля типа text/ntext/image?

Заранее спасибо
...
Рейтинг: 0 / 0
Cannot use text/ntext/image columns in the inserted and deleted tables
    #32014621
Glory
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
У вас я так понимаю SQL7, а цитата из BOL для SQL2000, но все же объясняет ситуацию

"In a DELETE, INSERT, or UPDATE trigger, SQL Server does not allow text, ntext, or image column references in the inserted and deleted tables if the compatibility level is equal to 70 .The text, ntext, and image values in the inserted and deleted tables cannot be accessed. To retrieve the new value in either an INSERT or UPDATE trigger, join the inserted table with the original update table.

When the compatibility level is 65 or lower, null values are returned for inserted or deleted text, ntext, or image columns that allow null values; zero-length strings are returned if the columns are not nullable.

If the compatibility level is 80 or higher, SQL Server allows the update of text, ntext, or image columns through the INSTEAD OF trigger on tables or views.
"
...
Рейтинг: 0 / 0
Cannot use text/ntext/image columns in the inserted and deleted tables
    #32014624
Miha
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Спасибо, Glory

Т.е. получить старое значение поля text/ntext/image в триггере невозможно для 7.0?
...
Рейтинг: 0 / 0
3 сообщений из 3, страница 1 из 1
Форумы / Microsoft SQL Server [игнор отключен] [закрыт для гостей] / Cannot use text/ntext/image columns in the inserted and deleted tables
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


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