Link to home
Start Free TrialLog in
Avatar of crazyman
crazymanFlag for United Kingdom of Great Britain and Northern Ireland

asked on

simple : insert row then set parameter to scope_identity

im trying to insert a new row inside an execute sql task and store the scope_identity() into a variable, this is proving harder than I would have thought.

I have amanged to store it to a result set by doing

Insert into &.. ;
Select scope_identity();

 But then I have to use a loop to get the individual column from the result set, I dont like doing this because I only have one row so seems silly to loop through one row..

If you have any ideas, it would be appreciated.
ASKER CERTIFIED SOLUTION
Avatar of PedroCGD
PedroCGD
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial