How would you insert records into a SQL Server table via a loop using C# when comparing a field to an incremented variable?
Posted on 2012-12-23
I am developing a C# Windows platform application using VS2005.
I am also using SQL Server 2005 tables as the back end database.
How would you code a loop so that the int variable intBranch, is incremented by 1 starting with the initial value of 001 through 999 and for each value, intBranch
is compared to the value of field Left([CPS Account Number],3) of table tblFlLNExp.
If Left([CPS Account Number],3) of table tblFlLNExp = intBranch
INSERT INTO tblFlLNMod SELECT tblFlLNExp.* FROM
tblFlLNExp WHERE LEFT([CPS Account Number],3 = intBranch