Cari Blog Ini

02 Maret 2012

Validate Field For DATE using function ISDATE()

----Invalid date
SELECT ISDATE('30/2/2007')
--RETURNS : 0 (Zero)


----Valid date
SELECT ISDATE('12/12/2009')
--RETURNS : 1 (One)

----Invalid DataType
SELECT ISDATE('SQL')
--RETURNS : 0 (Zero)


Source:
http://blog.sqlauthority.com/2007/07/12/sql-server-validate-field-for-date-datatype-using-function-isdate/