How to transfer a data from one table to another
-
Sunday, March 17, 2013 4:58 AM
cmd.CommandText = "insert into TBL_DEPOSITTRANS (DepositName, AccountNo, Receipt, InterestAmt, Date1, TransNo) select (name, acc_no, amount, fine, date, recept_no ) from temp WHERE status='N'"
but during execution an error occured likeIncorrect syntax near ','
All Replies
-
Sunday, March 17, 2013 5:02 AMModerator
Does the table tbl_DepositTrans have any triggers?
Also, you don't need () after SELECT. In other words, your code should be
cmd.CommandText = "insert into TBL_DEPOSITTRANS (DepositName, AccountNo, Receipt, InterestAmt, Date1, TransNo) select name, acc_no, amount, fine, date, recept_no FROM temp WHERE status='N'"
For every expert, there is an equal and opposite expert. - Becker's Law
My blog- Marked As Answer by Allen Li - MSFTModerator Monday, March 25, 2013 5:32 AM
-
Sunday, March 17, 2013 5:37 AM
cmd.CommandText = "insert into TBL_DEPOSITTRANS (DepositName, AccountNo, Receipt, InterestAmt, Date1, TransNo) select (name, acc_no, amount, fine, date, recept_no ) from temp WHERE status='N'"
but during execution an error occured likeIncorrect syntax near ','
you dont need brackets with Select statement..
cmd.CommandText = "insert into TBL_DEPOSITTRANS (DepositName, AccountNo, Receipt, InterestAmt, Date1, TransNo) select name, acc_no, amount, fine, date, recept_no from temp WHERE status='N'"
Try this it will work )
Please Mark as Answer if my post works for you or Vote as Helpful if it helps you. Kapil Singh

