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
 Transact-SQL (2000)
 Inserting multiple tables into one table

Author  Topic 

steppinthrax
Starting Member

27 Posts

Posted - 2009-09-30 : 12:30:05
I have one table that I'm inserting multiple records that are comming from 3 different functions.

See below


INSERT INTO tb_ing (ing_reci, ing_desc, ing_amt, ing_unit) select @scope, dbo.udf_split(@ing_desc,'|'), dbo.udf_split(@ing_amt,'|'), dbo.udf_split(@ing_unit,'|')


NOTE: @Scope is an identity value that is supposed to repeat for all row values.

dbo.udf_split is a function. That returns a one column table of values with the col name of "Items". EACH FUNCTION RETURNS THE SAME NUMBER OF ROWS.

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2009-09-30 : 13:52:21
I don't see a question or a problem, but since you posted on this forum I'll assume you have at least one of each!

Is the problem that each function is table-valued , rather than scalar-valued? Do the records produced by each split link together in any way?


Jim

Everyday I learn something that somebody else already knew
Go to Top of Page
   

- Advertisement -