Viewing 11 posts - 16 through 26 (of 26 total)
An alternative way of doing it
but better was to create a calendar table with relevant columns, like the ones in the CTE's in the function, then its just a select...
November 24, 2016 at 8:36 am
you can replace that CURSOR with
--Add variable all text of Proc, no need for CURSORS
DECLARE @QueryAll AS VARCHAR(MAX)
SELECT@QueryAll = COALESCE(@QueryAll,' ') + ProcTxt
FROM#TempProcScript
November 22, 2016 at 4:10 am
i know that, was an try to explain of what i want
The Dixie Flatline (8/25/2016)
Sorry, but functions can't call procedures. They can only call other functions....
August 26, 2016 at 3:41 am
ok, now can we go back to the discussion?
August 25, 2016 at 10:24 am
can you go back to the point of the discussion as i ask?
this is not about hollidays, it was a example, the focus is what i post before
paulo.margarido (8/25/2016)
August 25, 2016 at 9:45 am
I mark The Dixie Flatline answer as solution, because is a good idea
to implement it i need to add a as many columns to my holidays table as distinct parameters...
August 25, 2016 at 4:01 am
Thanks
That was no quite the point, but it helped and give me a nice starting point to go
As i say, i have no performance problems, its a small table, i...
August 24, 2016 at 9:53 am
But this is the return data, returned by my SProc similar to the one of the example
just the two columns, column with "code for the function" and columns with its...
August 24, 2016 at 8:36 am
some sample return data:
FuncaoResultdate
------------------------------------------------------------------------------------------------------------------------------------------
DATEADD(d, 39, dbo.fncDiaPascoa(@Year))2016-05-05 00:00:00.000
dbo.fncProcurarData(DATEADD(D, 0,DATEADD(M, 9, DATEADD(YY, @Year-YEAR(0), 0))), 1, 7, 2 )2016-10-03 00:00:00.000
dbo.fncCalcularData(DATEADD(D, 0,DATEADD(M, 7, DATEADD(YY, @Year-YEAR(0), 0))), 2, 4)2016-08-29 00:00:00.000
fncDiaPascoa() gives easter day for given...
August 24, 2016 at 7:31 am
i'm aware of what "inline table-valued functions" are, i have a few of my own in the DB
what i ask is how can i do it that way
if you can,...
August 24, 2016 at 7:22 am
Thanks for the response
There are not big performance issues, the table has only 400 rows
but is for the sake of making it better, and learn something with it
what do you...
August 24, 2016 at 6:45 am
Viewing 11 posts - 16 through 26 (of 26 total)