Quantcast
Viewing all articles
Browse latest Browse all 8

Functions in Functions

DECLARE @decBOM_Count INT

DECLARE @strBSC_Formula NVARCHAR(200)

 

-- For demo, is a parameter of the function

SELECT @strBSC_Formula = 'BR-(MW-25)-8'

 

--the next steps are, replacing all the variables in the formula by actual number-values

.

.

.

-- Here @strBSC_Formula contains something like '1000-(70-25)-8'

 

SELECT @strBSC_Formula = 'SET @decBOM_Count =' + @strBSC_Formula

EXEC sp_executesql  @strBSC_Formula, N'@decBOM_Count DECIMAL(10, 4) OUTPUT', @decBOM_Count OUTPUT

 

-- In @decBOM_Count I expect a number as result of the formula. 

 


Viewing all articles
Browse latest Browse all 8

Trending Articles