G
Guest
I have a requirement for my database to trim all data within all columns of
all leading and trailing spaces. My issue is that my code takes a long time
to process. I have 45 columns and there is alot of data within the table
itself.
The way I have been tackling this is through individual update SQL
statements as per:
DoCmd.RunSQL "UPDATE SYS_TBL_FILE_ENTRY SET [Member_Number] =
(Trim([Member_Number]));"
DoCmd.RunSQL "UPDATE SYS_TBL_FILE_ENTRY SET [Title] = (Trim([Title]));"
DoCmd.RunSQL "UPDATE SYS_TBL_FILE_ENTRY SET [First_Name] =
(Trim([First_Name]));"
DoCmd.RunSQL "UPDATE SYS_TBL_FILE_ENTRY SET [Middle_Name] =
(Trim([Middle_Name]));"
DoCmd.RunSQL "UPDATE SYS_TBL_FILE_ENTRY SET [Surname] =
(Trim([Surname]));"
DoCmd.RunSQL "UPDATE SYS_TBL_FILE_ENTRY SET [DOB] = (Trim([DOB]));"
etc etc etc
This is extremely slow.
Does anyone have a better way of doing this?
Cheers
Neil
all leading and trailing spaces. My issue is that my code takes a long time
to process. I have 45 columns and there is alot of data within the table
itself.
The way I have been tackling this is through individual update SQL
statements as per:
DoCmd.RunSQL "UPDATE SYS_TBL_FILE_ENTRY SET [Member_Number] =
(Trim([Member_Number]));"
DoCmd.RunSQL "UPDATE SYS_TBL_FILE_ENTRY SET [Title] = (Trim([Title]));"
DoCmd.RunSQL "UPDATE SYS_TBL_FILE_ENTRY SET [First_Name] =
(Trim([First_Name]));"
DoCmd.RunSQL "UPDATE SYS_TBL_FILE_ENTRY SET [Middle_Name] =
(Trim([Middle_Name]));"
DoCmd.RunSQL "UPDATE SYS_TBL_FILE_ENTRY SET [Surname] =
(Trim([Surname]));"
DoCmd.RunSQL "UPDATE SYS_TBL_FILE_ENTRY SET [DOB] = (Trim([DOB]));"
etc etc etc
This is extremely slow.
Does anyone have a better way of doing this?
Cheers
Neil