Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how to write an UDF and run it

Author  Topic 

Dhanu
Starting Member

3 Posts

Posted - 2008-03-25 : 01:36:59
how to write an UDF and run it

pravin14u
Posting Yak Master

246 Posts

Posted - 2008-03-25 : 02:03:30
Refer Books Online
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2008-03-25 : 16:49:31
Typically ,
CREATE FUNCTION [OWNER].[FUNCTION NAME] (PARAMETER LIST)
RETURNS (return_type_spec) AS
BEGIN
(FUNCTION BODY)
END

There are a number of ways you can run it , including withing your stored procedure:
SELECT *, dbo.MyFunction()
FROM MyTable

Jack Vamvas
--------------------
Search IT jobs from multiple sources- http://www.ITjobfeed.com
Go to Top of Page
   

- Advertisement -