Learn More





Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...SQL and SQL Ser...SQL and SQL Ser...SQL to list modules/pages where files are usedSQL to list modules/pages where files are used
New Post
11/8/2013 6:25 PM


Would someone please post a SQL query that displays the file names and what modules/pages they are used in?

Thanks in advance,


New Post
11/9/2013 7:50 AM

What exactly are you trying to achieve here ?  What files are you trying to locate - what sort files are you looking for.

A dnn portal is made up of many thousands of different files and resources many of which are merged together to generate and display the content of each different page ... adding to this complexity ... is that fact that much of the content that is displayed does not come from a specific file - but instead is built up from tables of data and information stored in a MS SQL database.


New Post
11/24/2013 5:30 PM
I'm trying to maintain the links in my website for example, if I add a picture that I want to use in place of another I can find all the places where the picture is being used.
New Post
11/24/2013 6:08 PM

Because of the modular nature of dnn this not easily achieved.  DNN does not need to store a record anywhere specifically of the places that a file is used.  Instead each different type of module that exists in a DNN portal stores its own records of the files it uses - and the way that that information is stored can vary from module to module.

This is more complicated by the fact that HTML modules only store html markup - which might include links to files or might not - or might even include multiple links to the same file - and to complicate matters further could save those links in a couple of different ways depending on how the file was used or placed in the module.

For example:

an image can  be linked directly - /dnn_platform/portals/0/Images/Banner2.jpg
or as a fileticket - /dnn_platform/LinkClick.aspx?fileticket=5IBm1dba-wA%253d&portalid=0

But either way its just HTML - other modules store just the FileID - 1234
 or some might even store just a user path ../Images/Banner2.jpg

And exactly where the information is stored is widely varied - for example the image used by a user thumbnail is stored in a users profile - and accessed using its own path /profilepic.ashx?userId=64386&h=32  .

So to find all the places a file is used is bordering on impossible without some very complex sql queries.

However - if you do KNOW what the HTML looks like for an image you are trying to locate you could at least start by doing a sql query of the HtmlText table.

Select ModuleId from HtmlText where content like "%filename.jpg"

would get you the modules that it is used in.




New Post
12/13/2013 12:49 PM
Is your site crawled by google?
If so, why not search on google using site:www.MYSITE.COM link:filename.ext?
HomeHomeDevelopment and...Development and...SQL and SQL Ser...SQL and SQL Ser...SQL to list modules/pages where files are usedSQL to list modules/pages where files are used

These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
Try Evoq
For Free
Start Free Trial
a Demo
See Evoq Live
Need More Information?