Ibrahim Hafidh

SQL Server, Data Warehouse, Business Intelligence, Data Mining and Web Development

Joomla Components and Plugins

Posted by ihafidh on January 26, 2009

This post is completely different from my SQL posts and what this blog was initially meant to be but I do some web development on the side and wanted to have a quick reference for my favorite Joomla components and add-ons.
So here they are in alphabetical order:

Docman
Desc: Manage all your files – articles, audio, video.
URL:http://www.joomlatools.org/

FacileForms
Desc: Create custom forms on the fly.
URL:http://www.facileforms.biz/

LxMenu
Desc: Create cool looking DHTML menus.
URL:http://www.menu4joomla.com/

RSGallery2
Desc: Display your photos using this component.
URL:http://rsgallery2.net/

sh404SEF
Desc: Make your URLs Search Engine Friendly and up rank your site.
URL:http://extensions.siliana.com/

Syndicate
Desc: Turns on RSS feeds for your website.
URL:http://www.joomla.org/

Xmap
Desc: Create a sitemap to display on your site and to submit to search engines.
URL:http://joomla.vargas.co.cr/

Favorite Joomla plugins/mambots

AllVideos Plugin
Desc: Add audio and video players of your media files right into your content. Compatible with other components as well like Docman.
URL: http://www.joomlaworks.gr/

Jumi
Desc: Add custom code like PHP or JavaScript in your content pages.
URL:http://jumi.vedeme.cz/

JW Tabs & Slides Plugin
Desc: Add tabs and slides to better organize your content.
URL: http://www.joomlaworks.gr/

Posted in cms, development, internet, joomla, web | Leave a Comment »

Adding comments to an XMLA script

Posted by ihafidh on October 8, 2008

So I was trying to run an XMLA script and kept getting errors. Below is the script. You will notice that I used the same commenting as in T-SQL “- -”. Highlighting the XMLA script and executing it worked. So my commenting was wrong. It should be <!- – enter comments here – ->. The same as any XML document. I know for anyone familiar with XMLA or XML would say “DUH!, that is obvious” but it took me some poking to get it to work. I am so used to using the two dashes “- -” which is what is used in both T-SQL and MDX.

- – XMLA script to backup an SSAS database
<Backup xmlns=”http://schemas.microsoft.com/analysisservices/2003/engine”>
<Object>
<DatabaseID>Adventure Works DW</DatabaseID>
</Object>
<File>C:\Backup\SSAS\Adventured Works DW 20080218.abf</File>
</Backup>

Here is the correct way of commenting:

<!- – XMLA script to backup an SSAS database – ->
<Backup xmlns=”http://schemas.microsoft.com/analysisservices/2003/engine”>
<Object>
<DatabaseID>Adventure Works DW</DatabaseID>
</Object>
<File>C:\Backup\SSAS\Adventured Works DW 20080218.abf</File>
</Backup>

Posted in MDX, SQL2005, XMLA, programming | Leave a Comment »

Top University Courses for Free

Posted by ihafidh on October 2, 2008

I just received an email from a friend with links to top university courses for free. I checked them out and they are indeed free and what’s great about them is that they can contain classes for the entire semester and not just one class. They also get updated quite frequently so you can follow along with the professor. My favorite is the Berkley Webcasts which seems to have the most courses and you can subscribe to RSS feeds for each course.

Stanford free Courses
http://see.stanford.edu/default.aspx

Yale free Courses
http://oyc.yale.edu/

MIT free Courses
http://ocw.mit.edu/OcwWeb/web/courses/courses/index.htm

UC Berkeley YouTube Video Courses:
http://youtube.com/ucberkeley

UC Berkeley Webcasts:

http://webcast.berkeley.edu

Posted in deals, education, programming, references, tips | 1 Comment »

Just moved in…

Posted by ihafidh on September 22, 2008

from http://ihafidh.blogspot.com

WordPress is much faster in writing posts and bringing up the posts. The move was pretty easy as it allowed me to import my posts from blogger.

Posted in blog, performance | Leave a Comment »

Viewing Query Plans

Posted by ihafidh on September 18, 2008

This is more of a reminder to myself. I can’t always remember the commands to show the execution plan in text. It’s nice having the graphical interface but when you have a big execution plan then seeing it in text is much easier. Here are the commands:

– simple estimated execution plan
set showplan_text on
GO
–*** estimated execution plan with more detail. best to use this ****
set showplan_all on
GO
– actual execution plan. runs the query. so it’s better to use showplan_all for a big query 
set statistics profile on
GO
More detail here

Posted in SQL, performance | Leave a Comment »

Executing a BAT file in SSIS

Posted by ihafidh on September 4, 2008

I wanted to execute a batch file in SQL Server Integration Services, and I wanted to utilize two parameters from the Execute Process Task in SSIS: StandardOutputVariable and SuccessValue.

The reasons for using these two parameters is that I wanted to know if the external batch file failed or not. And I wanted to capture any error messages produced.
In SSIS, it is straightforward. Drag the “Execute Process Task” and select your .bat file.
For the StandardOutputVariable create a new string variable. For the SuccessValue specify 0.
Now, the tricky part is getting the SuccessValue to work with %ErrorLevel% from the bat file. To do that, make sure that the last line in your bat file is:
EXIT %ERRORLEVEL%
This will return the error level to the Execute Process Task. Otherwise, the process will always seem to succeed.
The other tricky part is getting an actual error message produced from the bat file. Apparently there are separate output streams produced by the bat file. So you have to use some redirection operators. I found this out via a blogger CrankyBit. Microsoft’s reference can be found here. Here is an example:
C:\WINDOWS\system32\ping.exe www.google.com >> mybat_log.txt 2>&1
Notice the 2>&1 at the end. That will send out the error message that you would normally see when executing in a command prompt.
So I used that to capture the error logs.
Finally, I echoed out a custom error message to send to the output variable. I can then use this variable to send out an email for notification.
So here is the complete bat file:
@Echo OFF

Echo ================== >> mybat_log.txt
Echo Start: %Date% %Time%
Echo.
Echo Start: %Date% %Time% >> mybat_log.txt

rem ==================================
rem 2>&1 sends the actual error message
rem http://technet.microsoft.com/en-us/library/bb490982.aspx
rem ===================================

C:\WINDOWS\system32\ping.exe www.google.com >> mybat_log.txt 2>&1

Echo ErrorLevel = %ERRORLEVEL% >> mybat_log.txt

IF %ERRORLEVEL% NEQ 0 (ECHO An error has occurred on the mybat.bat file.
Echo Please check the log file for more detail at D:\mybat_log.txt
) ELSE (ECHO The mybat.bat file ran successfully)

Echo.

Echo End: %Date% %Time%
Echo End: %Date% %Time% >> mybat_log.txt

Echo.
Echo —
Echo Sent from SQL Server SSIS Package

EXIT %ERRORLEVEL%

Posted in SQL2000, SQL2005, SSIS | Leave a Comment »

I’m still here and some great resources

Posted by ihafidh on July 31, 2008

Well, after a long break from blogging I am back. We have a new addition to the family so that kept me away. Actually, that and just being lazy to blog really.
Anyway, I recently came across some useful resources on SQL 2005 and thought I would share:

JumpStartTV
Great intro videos for beginners wanting to learn SQL 2005, SSIS, SSAS, etc. They are free but you have to register.

TechNet Virtual Labs: SQL Server 2005
These labs include SSAS, Management Studio, SSIS, Data Mining, etc.

How to use rank function in SQL Server 2005
A very easy to follow query example on the ranking functions: ROW_NUMBER, RANK, DENSE_RANK, and NTILE

Posted in SQL2005, stored procedures, tips | Leave a Comment »

Restore DB with Different Name – Limitation

Posted by ihafidh on November 14, 2007

Got this error trying to rename a SSAS 2005 database:
“Backup and restore errors: Restore under different DatabaseId/DatabaseName can not be done for a database with partitions with specific location.”

Apparently, there is a limitation with SSAS 2005 when you try to restore a database with a different name AND you have specified a different folder location for storage. Hopefully this limitation is removed in SQL2008.

I had specified a different location because I ran out of space on my default location.

Posted in AS2005, SQL2005, datawarehouse | Leave a Comment »

YTD and Time Dimension

Posted by ihafidh on November 1, 2007

I kept getting the following error when trying to do YTD calculations using MDX on a client cube:

VALUE #Error Query By default, a year level was expected. No such level was found in the cube.
FORMATTED_VALUE #Error By default, a year level was expected. No such level was found in the cube.

Here is the MDX to do a simple YTD:
SUM(YTD([Time].currentmember), [Measures].[Sales])

The MDX is good and works in every other cube including Adventure Works so I had to look deeper. I started changing keys thinking that the client did not set those up properly. I should have looked at the error message more closely because it alluded to what the problem was. It says, “No such level was found in the cube”. Well, I know it’s there because I can see it in the dimension structure. However, looking at the dimension properties, the Year attribute was set to Regular as the Type. Changing the Type to “Years” solved the issue. So that makes sense, the MDX parser was looking for a Year level but could not find it.

Sometimes just figuring out what the error says helps a lot :)

Posted in AS2005, MDX, SQL2005 | Leave a Comment »

Moving SSAS 2005 database to another drive

Posted by ihafidh on October 30, 2007

I just got asked how to move a SSAS 2005 database from one drive to another. The default data folder is the C: drive when you install SQL 2005. Usually, the data drive that system admins assign is the D: , F: , etc drive.
So how do you move a SSAS 2005 database? Well, apparently you can’t move individual databases, you have to move the entire data folder to another drive. You also have to change the server property DataDir to the new location.
The steps are outlined here.
It would have been nice to allow moving individual databases like we do in regular SQL with detach/attach or restore to a new location.

Posted in AS2005, SQL2005 | Leave a Comment »