December 8, 2003 at 11:33 pm
Is there any opportunity to write my own aggregate function, such as SUM,COUNT...
I asked this question yesterday but it has disappeared somewhere...
December 9, 2003 at 12:11 am
Yes
BOL
CREATE FUNCTION
Creates a user-defined function, which is a saved Transact-SQL routine that returns a value. User-defined functions cannot be used to perform a set of actions that modify the global database state. User-defined functions, like system functions, can be invoked from a query. They also can be executed through an EXECUTE statement like stored procedures.
My Blog:
December 9, 2003 at 12:21 am
I don't think you can create functions like SUM,Count with UDF.
December 9, 2003 at 2:16 am
Here is your first question and my reply
http://www.sqlservercentral.com/forum/link.asp?TOPIC_ID=18953
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
December 9, 2003 at 2:23 am
quote:
YesBOL
CREATE FUNCTION
Creates a user-defined function, which is a saved Transact-SQL routine that returns a value. User-defined functions cannot be used to perform a set of actions that modify the global database state. User-defined functions, like system functions, can be invoked from a query. They also can be executed through an EXECUTE statement like stored procedures.
It's not a thing I asked
I want to write
select MyFunc(x) group by y
December 9, 2003 at 2:30 am
quote:
I don't think you can create functions like SUM,Count with UDF.
It seems me so, but may be some extended (C++) will help?
December 9, 2003 at 2:34 am
Writing your own extended procedure?
What difference should that make?
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
December 9, 2003 at 2:52 am
quote:
Writing your own extended procedure?What difference should that make?
Frank
You ask questions instead of giving answers
December 9, 2003 at 3:19 am
Yes, I do.
With writing your own extended stored procedure you only extend to functionality of SQL Server, not the built-in functions.
I see no chance for you.
What aggregate function do you want to implement?
If this is for academical purposes, you might want to try to implement this into an open source db like http://www.mysql.com/maxdb
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
December 9, 2003 at 3:30 am
Thank you. When I asked this question I suspected that I have no chances, and knowing a litle about writing DBMS, supposed, that only way is to update DBMS source code. But I had a hope...
December 9, 2003 at 3:45 am
For this purposes I strongly suggest trying to follow open source code from mysql and/or maxdb. Not easy to get an entry point, but great way to look behind the scenes.
My best bet is that SQL Server or any other RDBMS handle things that are coded there not totally different.
Frank
Edited by - Frank kalis on 12/09/2003 03:45:48 AM
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
December 9, 2003 at 10:32 pm
they say, that Yukon will allow such functions. Is it so?
December 10, 2003 at 3:08 am
I haven't dived too much into Yukon stuff yet, but as far as I understand some new features, you can write database code in some CLR language, pretty much as an alternative to T-SQL.
Still I don't think you can go down on this 'low level', but I'm not 100% sure on this and Yukon.
How would this comply with any SQL standard?
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply