We have a stored procedure which calls a table valued function like this
DECLARE @PID INT
DECLARE @PCost DECIMAL(30,15)
SELECT @ID = PID, @PCost = Cost
FROM [dbo].[myfunction] (@param1, @param2)
but when we try to generate a .dacpac
from SSMS, we get this error
Error SQL71501: Error validating element [dbo].[MySP]: Procedure: [dbo].[MySP] has an unresolved reference to object [dbo].[myfunction].[Cost].
Error SQL71501: Error validating element [dbo].[MySP]: Procedure: [dbo].[MySP] has an unresolved reference to object [dbo].[myfunction].[PID].
My table valued function looks like this
ALTER FUNCTION [dbo].[myfunction]
(@param1 INT NULL,
@param2 INT NULL)
RETURNS @temptable TABLE (PID INT, Cost DECIMAL(15,5))
AS
BEGIN
INSERT INTO @temptable
// some select statements
RETURN
END
The stored procedure works fine without any issues but the error is only when trying to extract datatier .dacpac
from SSMS. Does anybody have any idea what's going on in here ?
question from:
https://stackoverflow.com/questions/65598469/error-sql71501-error-validating-element-on-a-stored-procedure 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…