Maybe it needs to register something in the backend to work and that takes time?
Nothing needs to refresh. You can refresh your intellisence cache with CTRL-SHIFT-R.
What happens when you try:
CREATE FUNCTION [dbo].[leadPerformance]
(
@startDate datetime,
@endDate datetime
)
RETURNS TABLE
AS
RETURN
(
SELECT USERID, USERNAME,CREATEDATE
from sysdba.USERINFO
WHERE CREATEDATE > @startDate
and CREATEDATE <@endDate
)
GO
ALTER FUNCTION [dbo].[leadPerformance]
(
@startDate datetime,
@endDate datetime
)
RETURNS TABLE
AS
RETURN
(
SELECT USERID, USERNAME,CREATEDATE
from sysdba.USERINFO
WHERE CREATEDATE > @startDate
and CREATEDATE <@endDate
)
GO
I hope you found this helpful! If you did, please vote it as helpful on the left. If it answered your question, please mark it as the answer below. :)