Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
create table Test1
(
  WRO varchar(10),
  Test_No varchar(10),
  TestDate datetime
);

insert into Test1(WRO,TestDate) values('T0001',now());
create table Test2
(
  WRO varchar(10),
  Test_No varchar(10),
  Test2Date datetime,
  TestAmount varchar(10)
);

i have to update on Test1 Test_No after insert on Test2 table Test_No both have
common field WRO

please help me


Thanks in Advance...
Posted
Updated 9-Oct-12 22:47pm
v3

Hi haresh,
I can show you an another easy way, U can use scope_identity() which will give you the last inserted value. Declare a variable and maintain the scopeidentity, which you can use in the update statement below of your insert statement.

SELECT SCOPE_IDENTITY() AS [SCOPE_IDENTITY]
ThankYou
 
Share this answer
 
i solved my self...

thank you
 
Share this answer
 
Comments
Nelek 10-Oct-12 4:46am    
Then why don't you share your solution? It might help other people having the same problem in the future.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900