Posted by Erland Sommarskog on 07/12/06 22:09
R.A.M. (r_ahimsa_m@poczta.onet.pl) writes:
> I have one more question - concernign functions.
> I've written function:
>
> [SqlFunction(Name="GetCurrentDateText")]
> public static SqlString GetCurrentDateText()
> {
> DateTime dt = new DateTime();
> return dt.ToString();
> }
>
> And I have tried to create a function:
>
> CREATE FUNCTION GetCurrentDateText RETURNS nvarchar(MAX) AS EXTERNAL
> NAME DemoSQLServer.DemoGetCurrentDateText
>
> (according to Books Online) But I recive an error:
>
> Incorrect syntax near 'RETURNS'.
>
> I cannot guess what is wrong. Could you help me please?
Parentheses are mandatory, even for parameterless funtions.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
[Back to original message]
|