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
 General SQL Server Forums
 New to SQL Server Programming
 Inserting multiple rows at a time in SQL table.

Author  Topic 

sanjepau
Starting Member

5 Posts

Posted - 2009-05-26 : 06:10:19
Hi All,

Can anyone please let me know how to insert multiple rows at a time in a sql table using SSIS etl.my requirement is to fetch home phone and work phone of an employee.If anyone number is present then I have to insert only one row but if both the numbers are present then I have to insert two rows at a time in the sql table for both the numbers.

Any help will be highly appreciated.


Thanx in advance.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-05-26 : 11:44:28
are homephone and workphone two fields of your table? or are they held in same field with another field specifying type like home,work,...
Go to Top of Page

sanjepau
Starting Member

5 Posts

Posted - 2009-05-27 : 00:02:23
Yes they are the two fields of the table,there are many other details which I have to insert along with these fields.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-05-27 : 09:55:36
just do it like

INSERT INTO YourTable (columns....)
SELECT Columns...
FROM YourTable
WHERE homephone IS NOT NULL
UNION ALL
SELECT Columns...
FROM YourTable
WHERE homephone IS NOT NULL
Go to Top of Page
   

- Advertisement -