Search
  
 
Mitchel Sellers' DotNetNuke, .NET, and Other Topics BlogMinimize
 
 
Subscribe To Blog Updates by E-Mail

Current Articles | Categories | Search | Syndication

Articles from SQL
   
 What Modules Do I Have and How Many of Them?
By Mitchel Sellers on Tuesday, March 25, 2008 @ 1:53 PM
 
  173 Views :: 4 Comments :: :: DotNetNuke, Tutorials, SQL
 
 

Finding out how many modules you have installed on a site, and additionally how many times those modules are used is something that you would think is very simple within DotNetNuke.  However, it is a bit more complex than one would hope.  By default DNN does not provide a mechanism for you to perform this kind of research, however, I have a very simple SQL Script that will allow you to see ALL modules and from there the total number of instances (in all portals) and the total number of instances that are deleted (in the recycle bin).  From an administrative perspective this is a key piece of information to know.

 
 View Full Article... 
   
 DNN 4.6.0 Upgrade and Whitespace Filter Errors
By Mitchel Sellers on Wednesday, September 19, 2007 @ 6:55 AM
 
  650 Views :: 2 Comments :: :: DotNetNuke, Tutorials, SQL
 
 

As noted in my previous blog posting I have upgraded this website to be running DotNetNuke 4.6.0.  Prior to the upgrade this site was running DNN 4.5.2 and I performed a direct upgrade to 4.6.0.  Also as I mentioned in my previous posting the upgrade didn't go all that smooth, with the site being down for almost an hour as I worked out the "bugs" that I identified with the 4.6.0 upgrade.  This article will discuss one of the issues that I encountered relating to the Whitespace Filter.

 
 View Full Article... 
   
 Fixing Lockout Due to Profile Property Requirement
By Mitchel Sellers on Wednesday, August 01, 2007 @ 5:16 AM
 
  439 Views :: 5 Comments :: :: DotNetNuke, Tutorials, SQL
 
 

One problem I recently encountered myself is one that I see appearing every so often on the DotNetNuke forums. I was working with profile properties and I set a property as required but accidentally forgot to set it to visible. I then proceeded to update the preferences that require a valid profile for login. I am now effectivly locked out of my site as I did not have that property set for my host or admin account. In this article I will provide you the information needed to reset the custom properties and to get you back into your site.

 
 View Full Article... 
   
 SQL Formatter/Colorizer 1.0 Update
By Mitchel Sellers on Tuesday, July 31, 2007 @ 11:59 AM
 
  218 Views :: 0 Comments :: :: MitchelSellers.com, SQL, Announcements, Productivity Tools
 
 

I have just released a new version of the SQL Formatter/Colorizer utility.  This release is used to resolve issues caused by changes to the parent web service used for formatting!  You may download it for free from the "Software" section of this site.

 
   
 Determing SQL Server Table Size
By Mitchel Sellers on Friday, July 27, 2007 @ 2:35 AM
 
  3943 Views :: 4 Comments :: :: Tutorials, SQL
 
 

A common problem that I have recently encountered was trying to identify areas of my website database that were taking up the most physical storage space. At work I maintain a DotNetNuke installation that includes a 4.5 Gb reporting database and I was trying to pinpoint the exact sizes of ALL tables in my database and was having a few problems. I started using the "sp_spaceused" stored procedure but I had to run that for every table, I have over 200 tables in this database and it was just not feasiable for me to do it this way. Therefore I wrote a stored procedure that will perform all needed data calls and will return a result set with the data on all tables. In this post I will share the script as well as a few interesting things I learned while writing it.

 
 View Full Article... 
   
 Viewing Most Popular Links - Revisited
By IowaComputerGurus Host on Thursday, July 19, 2007 @ 5:02 AM
 
  190 Views :: 0 Comments :: :: DotNetNuke, SQL
 
 

A little over a month ago I posted a SQL Query that can be used to find the most popular links on a given portal. In that example if you had links that were being tracked that were files it would only show the fileid for the file and not the file name. Now since there has been a fair amount of reader demand I have created a new version of this query to actually show the URL for URL based links and to show the file name for file based links.

To successfully parse the "fileid=xx" portion of the results when needed I use the substring function to grab just the id so I can join to the files table to grab the file name. Due to the different methods needed for files and links I have done this via two queries and then used the "UNION" statement to combine the results for display. For you to use this on your portal you will need to be sure to modify the portalid value to match that of your portal.

--Get standard links
SELECT m.ModuleTitle,
        t.url,
        t.clicks,
        t.LastClick
FROM urltracking t
    
INNER JOIN Modules m
        
ON (t.ModuleId m.ModuleId)
WHERE t.PortalId 0
    
AND t.trackclicks 1
    
AND t.urltype <> 'F'
--Combine with the others
UNION
--Get File links
SELECT m.ModuleTitle,
        f.[FileName] 
as url,
        t.clicks,
        t.lastclick
FROM urltracking t
    
INNER JOIN Modules m
        
ON (t.moduleid m.moduleid)
    
INNER JOIN Files f
        
--Grab the file id from the url field for the join
        
ON (CAST(SUBSTRING(t.url, 8LEN(t.url)) as intf.fileid)
WHERE t.urltype 'F'
ORDER BY t.clicks DESC, url

Please post any comments/questions below

 
   
 Fixing DNN Errors that are Related to Search Scheduler
By Mitchel Sellers on Wednesday, July 18, 2007 @ 4:09 AM
 
  2626 Views :: 27 Comments :: :: DotNetNuke, Tutorials, SQL
 
 

I have noticed a number of posts recently on the DotNetNuke.com forums regarding numerous errors being reported in the event log relating to portal id of -1 and typically with a InnerException of "Value cannot be null. Parameter name: type". This issue can become very annoying and can have an actual effect on your sites performance as when the size of the event log grows you will start to notice performance slow downs. This article will discuss the root cause of the issue and a solution.

 
 View Full Article... 
   
 Identifying Popular Links Portal Wide
By IowaComputerGurus Host on Wednesday, June 06, 2007 @ 10:00 AM
 
  209 Views :: 6 Comments :: :: DotNetNuke, SQL
 
 

After having my DNN sites up and running for almost a year I was very curious to see exactly how many clicks I had on the various tracked links.  I started to look around and was getting tired of clicking "Edit:" on each link to view the information.  So I created this simple query to quickly pull the links in the "Most clicked" order. 

This is a very primitive query that gets the module name, link, click count and last click time.  For documents loaded in the documents module you will only get the file id of the file, but it at least helps to illustrate the activity.

SELECT m.ModuleTitle, t.url, t.Clicks, t.LastClick
FROM URLTracking t
    
INNER JOIN Modules m
        
ON (t.ModuleId m.ModuleID)
WHERE t.PortalId 0
    
AND TrackClicks 1
ORDER BY t.Clicks DESC

You will need to edit the PortalId portion of the where clause to ensure that you reference the correct portal.

 
   
 Creating a Standard DotNetNuke User Via SQL
By Mitchel Sellers on Monday, May 14, 2007 @ 6:47 AM
 
  2776 Views :: 11 Comments :: :: DotNetNuke, Tutorials, SQL
 
 

Due to popular request this article discusses the steps necessary to create a new standard DotNetNuke user account based on the password for an existing user.  This is a follow-up article from my creating a host account via SQL Server that was published about a month ago.

 
 View Full Article... 
   
 View Statistics of your News Article Module Blog
By Mitchel Sellers on Thursday, May 03, 2007 @ 5:06 AM
 
  546 Views :: 4 Comments :: :: DotNetNuke, Tutorials, SQL
 
 

As I see more and more people using the Ventrian News Articles module for their blogs I have to imagine that others are curious as I am as to which blog posts are the most popular, the highest rated, or maybe even the lowest rated.  Yes I understand that I could look through my blog and find this out, but with as many posts as I have I decided to do some research and have made a few helpful queries that will provide this type of information.  This entry will walk you through each of the scripts.

Click "Read More..." to view the scripts and the remainder of the article

 

 
 View Full Article... 
   
 Migrate DotNetNuke Blog Entries to Ventrian News Articles
By Mitchel Sellers on Saturday, April 07, 2007 @ 12:15 AM
 
  1340 Views :: 3 Comments :: :: DotNetNuke, Tutorials, SQL
 
 

As promised this is a detailed migration process article that shows you how to move existing DotNetNuke blog entries over to the Ventrian News Articles module.  This is the exact process that I just used to migrate the blog on this site! 

 
 View Full Article... 
   
 Changing Skins via Database (Emergency Procedures)
By Mitchel Sellers on Sunday, April 01, 2007 @ 7:00 PM
 
  612 Views :: 1 Comments :: :: DotNetNuke, Tutorials, SQL
 
 

At one point or another it seems that almost everyone accidentally makes a change to a DNN installation that ends up breaking things. One of these situations that I never considered in the past was the accidental application of a skin with errors. I was contacted by someone today that accidentally applied a skin that caused a null reference exception, this caused the entire site to be unavailable. They couldn't access any pages and couldn't get back to the skin admin pages. Well, this lead me to find a method of resolving the issue via the database. In this entry I will describe the steps needed to change the skin to a default skin via the database.

 
 View Full Article... 
   
 Promoting DNN User to Super user
By Mitchel Sellers on Saturday, February 24, 2007 @ 1:00 AM
 
  435 Views :: 4 Comments :: :: DotNetNuke, Tutorials, SQL
 
 
This follow-up post discusses the process to change a user account to a "host" account via SQL. This is a followup from my previous blog regarding creating a DNN Host account via SQL.
 
 View Full Article... 
   
 Creating DotNetNuke Host Account Via SQL
By Mitchel Sellers on Friday, February 23, 2007 @ 1:00 AM
 
  1414 Views :: 12 Comments :: :: DotNetNuke, Tutorials, SQL
 
 
This posting provides a guide on how to create a new host account within DotNetNuke from your SQL Database. This is very helpful if you ever get locked out of your host account for any reason or for all of the new DotNetNuke users that have been having installation problems with the host and admin accounts. NOTE: this is provided for your use at your own risk!
 
 View Full Article... 

 Add to Technorati Favorites
 Print   
 
  
 
ArchiveMinimize
 
 
 Print   
 
  
 
CategoriesMinimize
 
 
 Print   
 
  
 
DonateMinimize
 
 

Show your appreciation for the content/modules made available by MitchelSellers.com by making a donation. Donations are used to assist with dedicating time to creating free content. 

 Print