Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.03.28;
Скачать: CL | DM;

Вниз

Как найти/удалить NULL записи в столбце типа DateTime (MS SQL)   Найти похожие ветки 

 
Layner ©   (2004-02-27 09:09) [0]

У меня есть там пустые записи, хотел бы удалить, а .. никак не удаляет, не видит их и все.. делал так, никак...
DELETE FROM login WHERE len(time_in)<1
DELETE FROM login WHERE time_in=NULL

По селекту их соответственно так же не отбирает :(


 
Sergey13 ©   (2004-02-27 09:12) [1]

time_in is NULL


 
Nikolay M. ©   (2004-02-27 09:28) [2]

Вдогонку, чтобы работало

> WHERE time_in=NULL

нужно сначала установить
SET ANSI_NULLS OFF


 
Layner ©   (2004-02-27 09:37) [3]

Спасибо! Все получилось!


 
Fiend ©   (2004-02-27 09:44) [4]

То Nikolay M. ©   (27.02.04 09:28) [2]
Это для чего? чтобы было легче идентифицировать нулы?


 
Nikolay M. ©   (2004-02-27 09:59) [5]


> Fiend ©   (27.02.04 09:44) [4]

Цитата из BOL, лень пересказывать и так все понятно:


SET ANSI_NULLS
Specifies SQL-92 compliant behavior of the Equals (=) and Not Equal to (<>) comparison operators when used with null values.

Syntax
SET ANSI_NULLS {ON | OFF}

Remarks
The SQL-92 standard requires that an equals (=) or not equal to (<>) comparison against a null value evaluates to FALSE. When SET ANSI_NULLS is ON, a SELECT statement using WHERE column_name = NULL returns zero rows even if there are null values in column_name. A SELECT statement using WHERE column_name <> NULL returns zero rows even if there are nonnull values in column_name.

When SET ANSI_NULLS is OFF, the Equals (=) and Not Equal To (<>) comparison operators do not follow the SQL-92 standard. A SELECT statement using WHERE column_name = NULL returns the rows with null values in column_name. A SELECT statement using WHERE column_name <> NULL returns the rows with nonnull values in the column.



Страницы: 1 вся ветка

Текущий архив: 2004.03.28;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.024 c
14-1077629736
kaif
2004-02-24 16:35
2004.03.28
Отставка правительства?


8-1069178308
Serg
2003-11-18 20:58
2004.03.28
Как закрыть окно после проигрывания mpeg файла?


7-1072851443
Andrey V.
2003-12-31 09:17
2004.03.28
Прослушать com-порт


4-1074492106
DeScriptor
2004-01-19 09:01
2004.03.28
Как добыть текст из окна типа MessageBox?


9-1062154209
Darrin
2003-08-29 14:50
2004.03.28
Сетевые шахматы