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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 User-defined function returning a dynamic recordset

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-10-04 : 08:03:25
Athir writes "I'm looking to build a user-defined function that returns a table based on a dynamic sql statement. The results of this sql statement may have a different number of columns (and different names) each time it is called. Any ideas?

Thanks,
Athir"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-10-04 : 08:06:08
You cannt use Dynamic SQL inside function
You need to use Stored Procedure
Refer this
http://www.sommarskog.se/dynamic_sql.html

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -