I am trying to create a function in SQL 2000. Im rusty on function
syntax and need to also assign some variables for use within this
function.
Example:
create function blah (@param1 int)
declare @var1 int, @var2 int
--it doesnt like this method of assigning values to my
variables??????????
select @var1, @var2 = (select name, phone from customer where id =
@param1)
--Then I need to use those variables in this next statement...
DECLARE @Zip int
SELECT @Results = (select zip from table2 where name = @var1 and phone
= @var2)
return @Results
-----------------------------------
Any help would be greatly appreciated at filling in the missing
syntax.