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)
 Multistatement Table-Valued Functions

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-03-21 : 08:30:32
sam writes "I wrote a function, fn_myTable(ID), to return a rowset with 5 columns. This function is used in a stored proc where I want to select one column from my function and some other records from another table.

I tried the following:

Select fn_MyTable(222).Coln2, userID
from tableUser
where ...

By running it, I got an error saying "Incorrect syntax near '.'."

So I tried another way:

Select fn_MyTable.Coln2(222), userID
from tableUser
where ...

This tiem the error says, "Invalid object name 'fn_IBS_RPT_RollFormSalesAmtTable.TOTALSALES'."

What should I do in order to get the select statement working?

Thank you for help.

Sam"

dev45
Yak Posting Veteran

54 Posts

Posted - 2005-03-21 : 08:43:11
what is coln2 ? i am not sure u need it...
something like
select dbo.fn_mytable(id), userID from...
maybe ? (make sure to include the owner of the function, i guess it is dbo.)
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-03-21 : 08:43:36
post the full function code

Madhivanan

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

- Advertisement -