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)
 union all on insert

Author  Topic 

ccrespo
Yak Posting Veteran

59 Posts

Posted - 2007-09-06 : 14:31:55
hi is there any way to do this:
INSERT INTO OUTREACH
(RecallId,Number,ContactMethodId,OutreachStatusId,LastContactDate,NextContactDate,
Created,CreatedBy)
SELECT
@RecallId,1,1,NULL,NULL,@RecallDate,getdate(),@User union all
@RecallId,2,1,NULL,NULL,@RecallDate,getdate(),@User union all
@RecallId,3,1,NULL,NULL,@RecallDate,getdate(),@User

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2007-09-06 : 14:39:28
[code]INSERT INTO OUTREACH
(RecallId,Number,ContactMethodId,OutreachStatusId,LastContactDate,NextContactDate,
Created,CreatedBy)
SELECT
@RecallId,1,1,NULL,NULL,@RecallDate,getdate(),@User union all SELECT
@RecallId,2,1,NULL,NULL,@RecallDate,getdate(),@User union all SELECT
@RecallId,3,1,NULL,NULL,@RecallDate,getdate(),@User[/code]

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

ccrespo
Yak Posting Veteran

59 Posts

Posted - 2007-09-06 : 14:52:06
thanks..!
Go to Top of Page
   

- Advertisement -