Contribute  :  Support  :  Downloads  :  Forum  :  Links  :  Polls  :  Calendar  :  Directory  :  Advanced Search  
Geeklog The Ultimate Weblog System
Welcome to Geeklog
Tuesday, May 13 2008 @ 04:10 AM EDT
   

Geeklog 1.4.1 Microsoft SQL Server Support

GeeklogThe objective of the Microsoft SQL (MSSQL) port is to provide another database alternative to MYSQL to take advantage of SQL server in business environments where Mysql may be a barrier to entry. The goal was to provide the ability for GL1.4.0 to work in either Mysql or MS SQL server with zero code changes required to be done by the end user. The version(s) of SQL supported are SQL 2000 and above, including the MSDE.

An example plugin that was created to show an approach to isolate the database layer from the application logic can be found here in the downloads library.



Since Mysql has a few proprietary functions, it's impossible to have a MS SQL server equivalent function. A few examples are LIMIT, REPLACE INTO, UNIX_TIMESTAMP, TO_DAYS, DATE_FORMAT, DESCRIBE.... the list goes on and on. However the MSSQL class takes many of these into account and automatically translates some MYSQL specific function calls into SQL server equivalents.
Using the abilities of MS SQL server, I have written helper User-Defined-Functions (UDFs), views, triggers and stored procedures to assist SQL server in coping with MYSQL function calls as well as help GL1.4's code base cope with data differences between MYSQL and SQL server.

The MSSQL class that I've written mimicks the MYSQL class' members that already exist in the /system/databases directory.

Installation of a SQL instance of Geeklog 1.4.1 follows the same steps as creating a fresh MySQL instance, however it has these slightly different dependencies:
  • PHP installed and configured to use the Microsoft SQL server extensions.
  • MS SQL server (MSDE) installed - any version 2000 or greater.
  • A SQL database and database user created for Geeklog to use. This item is no different than the comperable MySQL step for installation, but needs to be carried out on the SQL server by a user who has enough access rights to create new databases.
Once you have Geeklog 1.4.1 downloaded and the dependencies configured, you'll have to edit the config.php file to ensure that the database selection is changed from 'mysql' to 'mssql' (the $_DB_dbms parameter setting in config.php). Please note that the database configuration parameters for database, user and password within config.php sill require configuration to match the 3rd bulleted item above.

Important Notes:
Plugins which require MSSQL support will require a MSSQL installer file and database detection routine developed to support SQL Server. I have personally converted some plugins to work on a MSSQL instance - just be aware that plugins specifically written for MySQL will not work "out of the box" on the SQL Server instance.

Also note that the MSSQL class does not overcome badly coded SQL routines which MySQL may be more forgiving with. Properly formatted SQL statements are a must and become very important - so watch out for things like including the right columns for a group by clause.

The MSSQL class does NOT approximate each and every MySQL function for SQL server. Only those critical functions which Geeklog 1.4.1 relies on is approximated by the MSSQL class and supporting database functions, triggers and stored procedures.

Enjoy the new database abilities of Geeklog!

Story Options

Trackback

Trackback URL for this entry: http://www.geeklog.net/trackback.php/20060918173353100

Here's what others have to say about 'Geeklog 1.4.1 Microsoft SQL Server Support':

Geeklog - Geeklog 1.4.1 BETA 1
Tracked on Sunday, September 24 2006 @ 05:17 PM EDT

Geeklog 1.4.1 Beta from Plugin CMS
Recently GeekLog 1.4.1 Beta 1 was released. It includes MS SQL support and multi-language support for articles. These are the biggest news in this release but the new features are not limited to these new features. [read more]
Tracked on Tuesday, October 03 2006 @ 03:39 PM EDT

GeekLog: MSSQL Support from destr0yr's aslyum
Although I don't particularly have a use for the new feature, GeekLog has announced support for MSSQL.  Yay Geeklog. [read more]
Tracked on Wednesday, October 11 2006 @ 07:18 PM EDT

Geeklog - Geeklog 1.4.1 beta 2
Tracked on Sunday, November 05 2006 @ 12:05 PM EST

Geeklog - Geeklog 1.4.1rc1
Tracked on Sunday, December 17 2006 @ 11:51 AM EST

Geeklog - Geeklog 1.4.1
Tracked on Sunday, December 31 2006 @ 01:59 PM EST

Microsoft » Blog Archives » Microsoft. SQL Server 2005. Product Overview … Microsoft
Tracked on Monday, February 19 2007 @ 09:43 AM EST

Microsoft » Blog Archives » … Microsoft is introducing a new edition of
Tracked on Thursday, March 08 2007 @ 10:35 AM EST

Microsoft » Blog Archives » MSC2073 - Programming a Microsoft SQL Server 2000 Database
Tracked on Friday, April 06 2007 @ 01:33 PM EDT

Microsoft » Blog Archives » PHP installed and configured to use the Microsoft
Tracked on Friday, August 10 2007 @ 07:19 PM EDT

Geeklog - Geeklog 1.5 status
Tracked on Monday, April 14 2008 @ 03:50 AM EDT

Geeklog 1.4.1 Microsoft SQL Server Support | 2 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Geeklog 1.4.1 Microsoft SQL Server Support
Authored by: mevans on Tuesday, September 19 2006 @ 12:04 AM EDT
Randy, I just finished tweaking the SQL and writing the install for the Media Gallery plugin so it now fully supports MSSQL. Your work on the mssql class made my work pretty easy, thanks for the effort, great job!

Mark

---
Media Gallery - the ultimate gallery plugin for Geeklog - www.mediagallery.org
Reminder to Plugin Authors
Authored by: Tony on Sunday, October 08 2006 @ 09:49 PM EDT
It's not mentioned explicitly here but with the new support for MSSQL it should be recommended to all plugin authors/maintainers to do their best to write portable SQL. Writing standard (portable) SQL will make it possible for your plugins to make use of any Geeklog supported database with miminal effort.

--Tony

---
The reason people blame things on previous generations is that there's only one other choice.