SQL query to find rows that contain only numerical data

9saireddy blogspot Create Table TestTable
(
     ID int identity primary key,
     Value nvarchar(50)
)

Insert into TestTable values ('123')
Insert into TestTable values ('ABC')
Insert into TestTable values ('DEF')
Insert into TestTable values ('901')
Insert into TestTable values ('JKL')

select * from TestTable

select value from TestTable where ISNUMERIC(Value)=1

Then result will be as follows.
123
901

No comments:

Post a Comment

What is Normalization?

Database normalization is a data design and organization process applied to data structures based on rules that help building relational dat...