Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Wednesday, February 19, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Data & Imports Forums - T-SQL & Queries
Forum to discuss general T-SQL questions and help with queries related to SalesLogix data. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to T-SQL & Queries | New ThreadView:  Search:  
 Author  Thread: SQL Statement to Delete Image Files from Attachments
Roger Anttila
Posts: 1
 
SQL Statement to Delete Image Files from AttachmentsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 May 07 5:46 PM
fiogf49gjkf0d
Our email format has our logo at the bottom and we now have HUNDREDS of copies of the logo as "image001.jpg' files or some close variation. I could use a suggestion or working SQL example using Administrator 'Execute SQL' to delete records whose description contains 'image001.jpg'. I am close but always fail to parse. Currently trying something like: DELETE ATTACHMENT FROM ATTACHMENT WHERE ATTACHMENT.DESCRIPTION LIKE '%image001.jpg%'
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: SQL Statement to Delete Image Files from AttachmentsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 May 07 5:59 PM
fiogf49gjkf0d
Use this:

DELETE FROM ATTACHMENT WHERE DESCRIPTION LIKE '%image001.jpg%'
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: SQL Statement to Delete Image Files from AttachmentsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 May 07 5:59 PM
fiogf49gjkf0d
Keep in mind, this only deletes the row, not the actual file from the attachments directory.
[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: SQL Statement to Delete Image Files from AttachmentsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 May 07 2:12 PM
fiogf49gjkf0d
Application.BasicFunctions.DeleteFileAttachment will remove the record, attachment, and sync the change to remotes. Of course the major downside is this has to be done in client, so you'd have to script something.

The integrity checker for v7+ would be a perfect place for something like this, but DeleteFileAttachment is almost a necessity in a remote environment. I don't believe IC has full access to the Application.* object but if it did you could script it there. Otherwise you'd probably have to make a customization or a process that performs the necessary operations.
[Reply][Quote]
Bob (RJ)Ledger
Posts: 1103
Top 10 forum poster: 1103 posts
 
Re: SQL Statement to Delete Image Files from AttachmentsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 May 07 10:42 PM
fiogf49gjkf0d
The IC does not have access to the Application Object. It was designed for the main db only and not remote(s).
--
rjl
[Reply][Quote]
Bob (RJ)Ledger
Posts: 1103
Top 10 forum poster: 1103 posts
 
Re: SQL Statement to Delete Image Files from AttachmentsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 May 07 10:45 PM
fiogf49gjkf0d
Quote:
Originally posted by Jeremy Brayton

... Otherwise you'd probably have to make a customization or a process that performs the necessary operations.


Use remote task. It's there in the Admin. very simpl eto use and often overlooked.

We've even used it to wipe out remote db's or lock down a laptop when folks are terminated.
--
rjl
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 2/19/2025 4:53:27 PM