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)
 Can i create view based on a Function

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-06-15 : 08:21:31
Rohit writes "Dear team,

We are using SQL server 2000.
I am using a function for getting some data and it is returning a table. I have to pass 5 parameters say (a,b,c,d,e). After passing these parameters i'll get back the data i need.
I want to create a view based on this Function. So I am joining this function with a table. Like

function.a = table.a
function.b = table.b etc. But it is not giving me syntax error.

Whether it is possible to create a view based on a table level function? then what is correct syntax for it?

I tried this also:

Select * from function(Table.a,Table.b,Table.c,Table.d,Table.e) from Table.
Thanks in advance."

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-06-15 : 08:37:14
Select * from function(Table.a,Table.b,Table.c,Table.d,Table.e)?

Peter Larsson
Helsingborg, Sweden
Go to Top of Page

sqldev80
Yak Posting Veteran

68 Posts

Posted - 2006-06-15 : 12:21:46
Select * from function(Table.a,Table.b,Table.c,Table.d,Table.e) from Table will not work
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-06-15 : 12:56:11
quote:
Originally posted by sqldev80

Select * from function(Table.a,Table.b,Table.c,Table.d,Table.e) from Table will not work



Of course not, since the query optimizer does not now how to parse the syntax.

Write
Select                ff.*
from function(Table.a, Table.b, Table.c, Table.d, Table.e) ff
left/inner/cross join Table

Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -