General information
Forum:
Microsoft SQL Server
Title:
Finding Duplicate Text in a column
Environment versions
SQL Server:
SQL Server 2005
I have a database that receives imports (pictures) from our users. When the import is received text is added to one column (Narrative) stating “the following images were imported” (abbrevated sample).
An update was just implemented, but unfortunately this update sent the imports every 3 mins adding the “the following images were imported” statement each time. This created a column that prints out about 50-100 pages.
Now the update has been corrected and only adds text one time, however I have about 80 records with this multiple “the following images were imported” in the Narrative column.
My problem is trying to create a select statement to find the duplicates from the Narrative column, and then hopefully delete only the duplicate “the following images were imported” entries.
Here is an example of what's in the Narrative column (one record) of the table minus about 1000 duplicates. The “XXXX XXXXXXX” is just for the confidential info.
“On 05/22/2008 at 06:10 the following images were imported: - Crime Scene: XXXX XXXXXXX; Path: \\MPDPhotoServer\VisionImages\0805\0805012580ME\05222008053822.jpg - Crime Scene: XXXX XXXXXXX; Path: \\MPDPhotoServer\VisionImages\0805\0805012580ME\05222008053823.jpg - Crime Scene: XXXX XXXXXXX; Path: \\MPDPhotoServer\VisionImages\0805\0805012580ME\05222008053824.jpg - Crime Scene: XXXX XXXXXXX; Path: \\MPDPhotoServer\VisionImages\0805\0805012580ME\05222008053825.jpg
On 05/22/2008 at 06:13 the following images were imported: - Crime Scene: XXXX XXXXXXX; Path: \\MPDPhotoServer\VisionImages\0805\0805012580ME\05222008053822.jpg - Crime Scene: XXXX XXXXXXX; Path: \\MPDPhotoServer\VisionImages\0805\0805012580ME\05222008053823.jpg - Crime Scene: XXXX XXXXXXX; Path: \\MPDPhotoServer\VisionImages\0805\0805012580ME\05222008053824.jpg - Crime Scene: XXXX XXXXXXX; Path: \\MPDPhotoServer\VisionImages\0805\0805012580ME\05222008053825.jpg“
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only