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 2005 Forums
 Transact-SQL (2005)
 Table Valued Functions?

Author  Topic 

ddamico
Yak Posting Veteran

76 Posts

Posted - 2008-11-25 : 07:37:57
I know that you cannot pass a column name into a TVF in a query that calls the function in 2000. I read a blog referencing that is was possible in 2005 using the "censored" operator.

I have searched hi and low on google but have found nothing referencing it. Does anyone out here know if the CENSORED does exist and the context in which it is used? Also, any documentation online for this?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-11-25 : 07:50:04
Censored?

You mean CROSS APPLY and OUTER APPLY?



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

ddamico
Yak Posting Veteran

76 Posts

Posted - 2008-11-25 : 07:57:28
I am not sure it could be. The blog wasn't two clear it referenced the term "censored" this would allow you to pass a column name into a TVF from within a query.

SELECT *
FROM A
INNER JOIN tvf_a(a.col1) ON a.id = b.id

Will CROSS APPLY allow this?
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-11-25 : 08:03:59
Yes.
Don't take my word for it. You should check Books Online too.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-25 : 11:52:21
quote:
Originally posted by ddamico

I am not sure it could be. The blog wasn't two clear it referenced the term "censored" this would allow you to pass a column name into a TVF from within a query.

SELECT *
FROM A
INNER JOIN tvf_a(a.col1) ON a.id = b.id

Will CROSS APPLY allow this?


see this for an example

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=104485
Go to Top of Page

ddamico
Yak Posting Veteran

76 Posts

Posted - 2008-11-25 : 13:33:07
Thanks all... I have confirmed the CROSS APPLY does work and this is what the blog must have meant
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-25 : 13:36:22
yup..it will work. only thing is that you should be having sql 2005 or higher with compatibility level set to atleast 90
Go to Top of Page
   

- Advertisement -