Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug or Behaviour ?
Message
From
28/07/2003 09:36:59
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Bug or Behaviour ?
Miscellaneous
Thread ID:
00814082
Message ID:
00814082
Views:
50
Hi,

I have found MSQL documentation good ( not optimal !).

Then, on UDF i can't use GETDATE() ( a big limit ),
but:
CREATE FUNCTION dbo.fn_Scalar(@today DATETIME)
 RETURNS BIT
AS
 BEGIN
  RETURN 1
 END

CREATE FUNCTION dbo.fn_Table1(@today DATETIME)
RETURNS TABLE
RETURN SELECT CONVERT(BIT,1) value

CREATE FUNCTION dbo.fn_Table2(@today DATETIME)
RETURNS @R_TABLE TABLE (value BIT)
BEGIN
	INSERT @R_TABLE SELECT 1
	RETURN
END

-- execute this commands

SELECT dbo.fn_Scalar(GETDATE())
-- ok
SELECT * FROM dbo.fn_Table1(GETDATE())
-- syntax error
SELECT * FROM dbo.fn_Table2(GETDATE())
-- syntax error
Syntax error is a TSQL parser bug ?

If No:
- why TSQL have this limit ? I have big need of it.
- it is documented ?

Fabio
Next
Reply
Map
View

Click here to load this message in the networking platform