Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-05-16 : 08:28:12
|
| Diptiman Singh writes "Hi,I use SQL 7.0I have made a stored procedure which takes input as a varchar and returns int. Basically it is a fet to inches function.The data in the table is varchar.Now I need a view that has to essentially return inches along with other data, like...SELECT sp_feet2inch([length_feet]) AS Inches, Productname from ProductsIs there a way out?Can't upgrade to SQL 2000 as client won't allow it.Diptiman" |
|
|
JimL
SQL Slinging Yak Ranger
1537 Posts |
Posted - 2005-05-16 : 08:41:39
|
| Ok I gotta ask.If you are storing INT why would you have a Varchar Field?One Alpha in the field will cause your SP to fail.JimUsers <> Logic |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2005-05-16 : 14:14:14
|
Anything wrong with doing it like this?SELECT case when isnumeric([length_feet]) = 1 then convert(numeric(10,2),[length_feet])*12.00 else null end AS Inches, Productnamefrom Products CODO ERGO SUM |
 |
|
|
|
|
|