Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding Duplicate Text in a column
Message
 
 
To
23/05/2008 10:47:58
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01319211
Message ID:
01319214
Views:
14
Try
SELECT * FROM mytable
  WHERE Narrative LIKE '%the following images were imported%the following images were imported%'
>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“
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform