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 2005 Forums
 Transact-SQL (2005)
 Insert multiple records

Author  Topic 

Zath
Constraint Violating Yak Guru

298 Posts

Posted - 2009-08-28 : 13:00:42

Ok, need to insert multiple records at once.
The first field will all be the same.
The second field is in a temp table.

This won't work, but need to figure out what will....

INSERT INTO ImportAlertAgings SET ImportAlertID = @InvImportAlertID,
AgingImportAlertID IN ( #tempAging.AgingID )


Thanks,

Zath

rohitkumar
Constraint Violating Yak Guru

472 Posts

Posted - 2009-08-28 : 13:01:40
INSERT INTO....
SELECT...
Go to Top of Page

Zath
Constraint Violating Yak Guru

298 Posts

Posted - 2009-08-28 : 13:04:39
Yea, just figured it out LOL....

INSERT
ImportAlertAgings
SELECT
@InvImportAlertID,
ta.AgingID
FROM
#tempAging ta


Zath
Go to Top of Page
   

- Advertisement -