SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Inserting multiple tables into one table
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

steppinthrax
Starting Member

25 Posts

Posted - 09/30/2009 :  12:30:05  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

USA
2869 Posts

Posted - 09/30/2009 :  13:52:21  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000