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.
| Author |
Topic |
|
evanburen
Posting Yak Master
167 Posts |
Posted - 2010-04-05 : 13:31:18
|
| I have this function which works in SQL 2008 but I need something similar for an instance of SQL 2000 but receive the error message 'Select statements included within a function cannot return data to a client.'CREATE FUNCTION dbo.f_TotalRealizedCompensation_SP500RETURNS int--WITH RETURNS NULL ON NULL INPUTASBEGIN -- Declare the return variable here DECLARE @Return int SELECT AVG(ceototactcomp) FROM dbo.CompanyData WHERE INDEXSP = 'S&P 500' -- Return the result of the function RETURN @ReturnENDGO |
|
|
evanburen
Posting Yak Master
167 Posts |
Posted - 2010-04-05 : 15:50:54
|
| I was able to work this out |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|