I want to add a row to a table each time my function executes. SQL doesn't allow functions to write data directly so I'm looking for an alternative method.
-- My Function looks like this...
CREATE FUNCTION Foo
( @param1 int)
with MyValues as
( select 1 as val union all select 2 union all select 3 union all select 4 union all select 5 union all select 6
select * from MyValues where val > @param1
My table looks like this...
CREATE TABLE [dbo].[CallsToFooFunction](
[ID] [int] IDENTITY(1,1) NOT NULL,
[StartTime] [datetime] NULL, -- time function execution started
[Endtime] [date] NULL -- time function execution ended
) ON [PRIMARY]
Thanks in advance!