如何沒有輸入參數SQL功能參數
即時通訊歌廳一個錯誤下面的代碼創建一個SQL函數
create function function_name
RETURN datetime AS
BEGIN
DECLARE @var datetime
SELECT @var=CURRENT_TIMESTAMP
RETURN @var
END
錯誤
>
> Msg 156, Level 15, State 1, Procedure
> fx_getcurrent_date, Line 2 Incorrect
> syntax near the keyword 'RETURN'. Msg
> 178, Level 15, State 1, Procedure
> fx_getcurrent_date, Line 7 A RETURN
> statement with a return value cannot
> be used in this context.