【发布时间】:2019-05-07 05:04:18
【问题描述】:
我一直在阅读问题标题上的错误信息,但我无法弄清楚下面代码中的错误是什么:
CREATE function [RPT].[MonthlyRollupDates_Delimited]()
RETURNS @table TABLE (Value varchar(max))
AS
BEGIN
Declare @Count int , @Date date = getdate(),@Month int
SET @Month = MONTH(@Date)
SET @Count = @Month +12
Select
top (@Count)
CalendarDate, BusinessDay, Label
from MonthlyRollupDates
order by Calendardate desc
return
end
GO
我得到的错误是
函数中包含的 Select 语句不能将数据返回到 客户
【问题讨论】:
-
您使用的是哪个 dbms? (MS SQL Server?)
-
我正在使用 Microsoft SQL Server Management Studio
标签: sql-server tsql stored-functions