Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Updating

Author  Topic 

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2003-11-18 : 12:09:44
I am provided with a list every month of UK format postcodes. These are formatted so that they are 8 characters wide, which means that sometimes there is sometimes one space in the middle and sometimes more than one.

When my users type in postcodes they invariably type just one space (unless they make a mistake).

I have to join what a user has typed into one table to the table I am provided with. What is the best way to do this?

At the moment I create a new column which contains the same postcode but with the duplicate spaces removed, (I then put a clustered index on this column) as there are 2.5 million records this doesn't seem to be very effective in terms of space used (but I do have to use the original format as well as the one with duplicate spaces removed). This makes it easy to join the new column to the user typed one in any views etc I need.

Is the answer to use DTS when I import the data? Or to use a function, or to re-format the user entered data,.......??!?

Any suggestions hints etc appreciated

steve


Steve no function beer well without

X002548
Not Just a Number

15586 Posts

Posted - 2003-11-18 : 13:33:49
[code]
REPLACE(Col1,' ',' ')?
[/code]


Brett

8-)
Go to Top of Page
   

- Advertisement -