SQL - seraching for a real number in SQL database

I am looking for a store procedure that will help to search a real number for example 91.91

Any one know how to do it or any exisiting store procedure?

Thanks.
tommym121Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kyle AbrahamsSenior .Net DeveloperCommented:
It's a select statement.


create procedure searchNum
@input  Real
as

select * from <table> where <col> = @input
0
awking00Information Technology SpecialistCommented:
Search in what? A column in a table, all columns in a table, all tables in a schema, all tables in a database?
0
tommym121Author Commented:
I am try to search in the database for such a number (real and money)
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

tommym121Author Commented:
0
Kyle AbrahamsSenior .Net DeveloperCommented:
Shows the framework of how to loop through the entire database.  

Just change the last exec statement to not bring back the Left part of the column.

and change the where to @ColumnName = @SearchStr2
0
tommym121Author Commented:
ged325,

Real number is approximate not precise,  I need to set a tolerance like  abs(@ColumnName - @SearchStr2)/@SearchStr2 < Tolerance to see if @ColumnName = @SearchStr2.  Tolerance can be 10E-6
0
tommym121Author Commented:
How do I put such a formula in SQL where statement?
0
Kyle AbrahamsSenior .Net DeveloperCommented:
In that case do a between:

declare @min
declare @max


set @min = subtract tolerance from value

set @max = add tolerance to value

where @columnName between @min and @max
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tommym121Author Commented:
Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.