vendredi 29 juillet 2016

How to call function from function in sql

create FUNCTION [dbo].[fun1] 
(   
    @ID int
)
RETURNS TABLE 
AS
RETURN 
(
    declare @var int
select @var =select columnName from dbo.fun2(@id)
    SELECT @var* columnName  from
    table
    where table.id=@ID

)

How can I do it?

Aucun commentaire:

Enregistrer un commentaire