|
offlyn
Starting Member
1 Posts |
Posted - 08/13/2008 : 15:39:59
|
The follwoing sql works but I am looking for a better approach for doing this without using: from tbl1 a join tbl2 b on a.id = a.id
INSERT INTO tbl3 a.[id], b.[id] [CreatedBy], [CreatedDate] select distinct a.id, b.id, 1234, getdate from tbl1 a join tbl2 b on a.id = a.id where b.ID IN 1,2,3 and a.emailaddress in select distinct emailname from bulkuserupload
The dataset would be: id1 id2 createdby createddate 1 1 1234 12/1/2005 1 2 1234 12/1/2005 1 3 1234 12/1/2005 1 1 1234 12/1/2005 1 2 1234 12/1/2005 1 3 1234 12/1/2005
Thanks in advance for you input.
|
|