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.
| Author |
Topic |
|
yakoo
Constraint Violating Yak Guru
312 Posts |
Posted - 2001-11-09 : 15:31:16
|
| Im trying to write a DTS ActiveX task into strictly SQL.I am basically trying to take tables from linked servers, merge certain columns together, and push these values back to a main server. I used UNION to merge the two tables together and then GROUP BY and SUM to insert the "merged" data togheter into a temp table.I then either update or insert into the main table based upon the values in the temp table. This works fine except that in one particular case I need to know the IDs of the newly created records in the main server table so that I can create the related records in other tables on the main server.In this case my temp table contains all the primary information and two summary fields. One of these summary fields is associated with a "Users" table. The other summary field is associated with another table that needs the associated "UserID" to the "Users" table.I know this can be done using @@IDENTITY and CURSORS but I am trying to stay away from CURSORS as per discussions from this message board.Please let me know if all of this sounds unclear. |
|
|
|
|
|