Sunday, May 5, 2013

Inline table value function (tvf)


1. Produces a dynamic table at the time of execution
2. Unlike a view table valued function can be parameterized
3. Table valued function accepts a search criteria as function parameters; in a VIEW it is can be specified in a where clause 

VIEW:
create view view_person
as
select top 5 * from person.address
select * from view_person
TVF:
create function person.tvf_person
returns table
as
return
(
select * from person.address
);
go
select * from Person.tvf_person()

No comments:

Post a Comment