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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How do I use stored procedure in a SQL statement

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-05-16 : 08:28:12
Diptiman Singh writes "Hi,

I use SQL 7.0
I 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 Products

Is 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.

Jim
Users <> Logic
Go to Top of Page

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,
Productname
from
Products


CODO ERGO SUM
Go to Top of Page
   

- Advertisement -