Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi I have an issue to update data between two table. I want to update data from one table to another using Store procedure. My code is

SQL
SELECT NoMonth,ACC_P,StartDate FROM dbo.tbl_Accural_Basic
UPDATE WEB_tbl_Accural_Audit SET NoMonth=nomonth,ACC_P=ACC_P, StartDate=Startdate


But Nothing happend. It will show the data in select command
Pls help me
Maideen
Posted
Updated 24-Sep-13 3:08am
v2

Hai Maideen,

use this,

SQL
update updtab
set    updtab.NoMonth      = selecttab.nomonth
,      updtab.ACC_P        = selecttab.ACC_P
,      updtab.StartDate    = selecttab.Startdate
from   WEB_tbl_Accural_Audit updtab
,      dbo.tbl_Accural_Basic selecttab (nolock)
 
Share this answer
 
 
Share this answer
 

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