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 vs Views

Author  Topic 

cognos79
Posting Yak Master

241 Posts

Posted - 2008-04-24 : 11:05:21
Are there any disadvantages in respect to performance in using table valued functions instead of using a view.

Thanks...

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-04-24 : 11:47:38
no.
well ok.. you can't have indexed table valued functions like you can have views.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2008-04-24 : 14:14:58
quote:
Originally posted by spirit1

no.
well ok.. you can't have indexed table valued functions like you can have views.
In my experience TVF's perform terribly as it seems that SQL doesn't know how to handle them very well when joining to them. So, I'd have to disagree and say that if you are doing a join then a view is probably going to be much faster. However, if you are just selecting from one or the other then it probably won’t make much diference.
Go to Top of Page

cognos79
Posting Yak Master

241 Posts

Posted - 2008-04-24 : 14:36:58
I have do a join to TVF in my main query. I did write a query using TVF in the join and I didnt notice any performance slow down. the query executed with in no time.
Go to Top of Page
   

- Advertisement -