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 |
|
frank2
Starting Member
35 Posts |
Posted - 2005-09-09 : 14:39:52
|
| I have created a simple table-type UDF :ALTER FUNCTION UDF_TV_GetLineage( @DescendantID int)RETURNS tableAS RETURN ( select SiteGroupsID, Lineage from SiteGroups where @DescendantID = Child )When I run this as a stored procedure I see the result set, no problem. What I want to do is run the function in the query analyzer and see the result set. Running a scalar function in the Query analyzer is simple:print DBO.UDF_MyScalar('TEST1;TEST2', 2, DEFAULT)But when I attempt to run the table value function I get a not an object error. Any suggestions or URL’s where I can go to see examples?Thanks |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2005-09-09 : 14:50:35
|
| SELECT * FROM dbo.UDF_TV_GetLineage(...)Tara |
 |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2005-09-09 : 14:53:33
|
| >>Any suggestions or URL’s where I can go to see examples?Books Online. Look at the topic: CREATE FUNCTIONThere are example UDFs and calls towards the bottom of the topicBe One with the OptimizerTG |
 |
|
|
frank2
Starting Member
35 Posts |
Posted - 2005-09-09 : 15:47:28
|
| Ahhhh the table value function must be called from a SELECT. Thank you both:) |
 |
|
|
|
|
|