Форум: "Прочее";
Текущий архив: 2010.09.12;
Скачать: [xml.tar.bz2];
Внизmssql триггер, совсем забыл :(. Так правильно будет? Найти похожие ветки
← →
12 © (2010-06-15 15:02) [0]надо чтоб в таблице как только обновилось поле Subscr на 1 ставить дату, если обновляется на 0 - дата неопределена
Create TRIGGER rnrAlignmentUpdate_TRGR
ON dbo.rnrAlignment
AFTER UPDATE
AS
BEGIN
IF ( trigger_nestlevel() > 1) Return;
if Exists(select inserted.Id from inserted where inserted.Subscr = 1)
update rnrAlignment
set datatime = GetDate()
where Id in (select inserted.Id from inserted where inserted.Subscr = 1)
if Exists(select inserted.Id from inserted where inserted.Subscr = 0)
update rnrAlignment
set datatime = null
where Id in (select inserted.Id from inserted where inserted.Subscr = 0)
← →
12 © (2010-06-15 15:33) [1]вроде работает..
ладно, пойдет пока
← →
silver © (2010-06-15 15:35) [2]а унас погода хорошая
← →
Ega23 © (2010-06-15 15:43) [3]
if Exists(select inserted.Id from inserted where inserted.Subscr = 1)
update rnrAlignment
set datatime = GetDate()
where Id in (select inserted.Id from inserted where inserted.Subscr = 1)
Что-то как-то ректальненько....
← →
12 © (2010-06-15 16:03) [4]
> то-то как-то ректальненько....
согласен,
а как?
← →
test © (2010-06-15 16:17) [5]В Гугле забанили? Понимаю.
http://www.google.ru/codesearch?as_q=trigger+mssql&btnG=%D0%9F%D0%BE%D0%B8%D1%81%D0%BA+%D0%BA%D0%BE%D0%B4%D0%B0&hl=ru&as_lang=sql&as_license_restrict=i&as_license=&as_package=&as_filename=& as_case=
← →
12 © (2010-06-15 16:24) [6]
> В Гугле забанили
ну я же не спрашивал кода, примера, как примерно пишется или с чего начать
могут ли возникнуть траблы с моим триггером - вот что интересует.
← →
test © (2010-06-15 18:15) [7]12 © (15.06.10 16:24) [6]
Тогда пардон, студенты постоянно набигают))
Страницы: 1 вся ветка
Форум: "Прочее";
Текущий архив: 2010.09.12;
Скачать: [xml.tar.bz2];
Память: 0.46 MB
Время: 0.004 c