March 25, 2011 at 4:26 am
my bank has change their account from 5 digit to 8 digit.
every account has been changed by adding '212' in the end of account number.ex:
11111 ----> 11111212
22222 ----> 22222212
etc
i have many table with field account number. so, how to make stored procedure to accomplish this matter.
thanks for your help:-)
March 25, 2011 at 9:01 am
diboy79 (3/25/2011)
my bank has change their account from 5 digit to 8 digit.every account has been changed by adding '212' in the end of account number.ex:
11111 ----> 11111212
22222 ----> 22222212
etc
i have many table with field account number. so, how to make stored procedure to accomplish this matter.
thanks for your help:-)
is the account an integer or varchar? it makes a difference.
wouldn't it be something like this?:
--varchar
UPDATE YOURTABLE
SET Account = Account + '212'
WHERE LEN(Account) = 5
--int?
UPDATE YOURTABLE
SET Account = (Account * 1000) + 212
WHERE Account between 10000 AND 99999
Lowell
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply