Monday, August 31, 2009

MCTS 70-433 CREATE FUNCTION SIGNATURE

This example show a simple working function call:


create function dbo.fn_call_stp ()

returns int

as

begin

return (

  SELECT top (1) c

  FROM OPENROWSET('SQLNCLI', 'Server=servername;Trusted_Connection=yes;',

  'execute dbname.dbo.stp_call_from_udf') AS a)

end


There is a gotcha with function calls, if the return type is int(10) then returning a vanila int?



No comments: