hi guys
fairly new to sql so need a bit of help. im not sure how to and where to save self written sql function on sql database..
sql function I want to save on db
to get started off where would I save this function?
I then would like my front end asp page to call this function within my sql select statement
would the select statement be then something like
please advise. thanks in advance.
Omar.
fairly new to sql so need a bit of help. im not sure how to and where to save self written sql function on sql database..
sql function I want to save on db
Code:
CREATE FUNCTION MyConvertFunc (@InputVals int) RETURNS int AS BEGIN declare @convertedVal varchar(30) set @convertedVal = Cast(@InputVals * 0.9 as int) return @convertedVal end
I then would like my front end asp page to call this function within my sql select statement
would the select statement be then something like
Code:
select MyConvertFunc, * from tablename WHERE ID ='1'
Omar.
Comment