Link updating software that works with files in a database?

Posted on 2012-08-20
Last Modified: 2012-09-05
I have a website ( that uses a CMS to store files in a database. The files are either pdf, docs, or swf files. I would like to change the filenames of some of the documents that are stored in the database, but many of the swf, doc and pdf files link to these document so I need to be able to identify all places that link to these files and update them accordingly. Dreamweaver does this on sites that consist of files in the Dreamweaver "site."

Does anyone know is there is software available to will check and update links in files that are stored in a MSSQL database?

Question by:karnac2020
    LVL 11

    Expert Comment

    You do this manually using SQL language in SQL management studio.

    Possible queries to run are:
    select content_column from content_table where content_column like '%your_file_name%'

    update content_table
    set content_column = Replace(content_column, 'old_file_name', 'new_file_name')
     where content_column like '%old_file_name%'
    LVL 26

    Accepted Solution

    Hi karnac2020,

    you should probably look at changing how you serve up the documents from the db, I suspect you are serving them up by 'Name'.

      Select docBytes from tblDocs where [Name]='Some document name'
    should be:
      Select docBytes from tblDocs where [ID]=123

    If you had an associated 'ID' field for each document stored in the db, you could request the documents by 'ID', then changing the names of the documents at any time won't affect your document serving processes.

    Would need to see some of your code methods used for serving the docs and some associated SQL logic and structure in order to provide a more specific opinion.

    It's a good idea to store such docs in a db because asp .net framework and IIS services do not protect files that have an extension which is not associated with .net (.aspx, .config etc...). So even if you put .PDF files into a folder that is protected by the web.config, requiring a login to gain access, IIS will serve up .pdf, .doc and .swf files without hesitation, to any public user who can enter the correct path.

    Alan ";0)

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    This video teaches the viewer how to align pictures around text while keeping the text properly aligned in the document.
    This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now