You are here: Re: 2005: calling .NET procedure - one more question « MsSQL Server « IT news, forums, messages
Re: 2005: calling .NET procedure - one more question

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация