Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

table function

Status
Not open for further replies.

huong30

Technical User
Joined
Sep 9, 2008
Messages
4
Location
US
I had an existing function that return table value, which used to calculated the algorithm, work fine for individual input. However I had the need to run for the whole table...which I supposed I can do a while loop. I was wondering if there are other way to do this.

thx...


declare @id int
set @id=(select id from table where x=y)
select * from ufxFunction(@ID)

Want something similiar to this:

declare @id int,@Count int
set @count=(select count(*) from table)
set @id=1
while @id < @count
begin
insert into table2(x,y,z)
select x,y,z from ufxFunction(@ID)
@id=@id=1
end
 
Hard to say without knowing your table/function structure, but can you create a new, similar function to operate on the entire table and join that to table1 to insert to table2?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top