Find Non Integer From SQL Column

If you want to find Non-Integer from Column in SQL Server  that does not have Data Type integer , Use following SQL Query.




Select *  From [ChildRegistration]
    Where IsNumeric(ChildID + '.0e0') = 0



If you want to find Integer from Column in SQL Server  that does not have Data Type integer , Use following SQL Query.



Select *  From [ChildRegistration]
    Where IsNumeric(ChildID + '.0e0') = 1

Add Identity Column and Populate Column in SQL Server

Add Column using SQL Statment and Populate Identity Column in SQL Server

Alter Table ChildRegistration
Add RegistrationID  Int Identity(1000000,10)

1000000 Means Value Start with 1000000 and adding in 10 increment.

Add Default Constraint GetDate() to Existing Column

Add constraint default getdate to existing column


Alter table [dbo].[Child]
Add Constraint DF_Last Default Getdate() For [LastUpdate] 


Find Non Date in Column using IsDate

Suppose We have Employee Table with Hiring Date and HiringDate is with Data Type Nvarchar.
We want to find out which one is non date in Hiring Column ?



Find Non-Date Part from Column using SQL Query IsDate


Select * from Employee
Where IsDate(JoiningDate) = 0


Find Date Part from Column using SQL Query IsDate

Select * from Employee
Where IsDate(JoiningDate) = 1