create view v_getdate as select getdate() [output] go --------------------------------------------------------------- create function f_getdate() returns datetime as begin declare @n datetime select @n = output from v_getdate return(@n) end go ---------------------------------------------------------------