SqlServer 2005 Service Pack 1

Monday, 24 April 2006 14:04 by admin
SqlServer 2005 SP1 has just been released. Well a few days earlier I mean.
 
Yep, since the release of SqlServer 2005 on November 2005, Microsoft releases the first its very first service pack. For the information of others, the service pack has been on CTP (Community Technical Preview) stage for a few months now. I guess microsoft really sees the advantage of releasing CTP's for the public. Really hope this attitude continues for future upcomming releases!
 
There are two seperate downloads. One for the SqlServer 2005 Express and the other is for Enterise, Developer and Standard editions. You can download it here:
 
 
Express edition:
 
 
Here's a link on the list of fixes fixed in this release:
 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:  
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

The Database Express Editions Battle

Tuesday, 18 April 2006 15:04 by admin
A mid-scale database solution is one of the booming businesses nowadays. Many mid-sized companies are now moving to the IT trend. One of the obstacles that a company might encounter is the cost of database systems. I mean it’s not quite feasible for a mid-sized company to purchase a SqlServer Enterprise which costs $24,999 plus 25 users CAL which amounts to $13,969 or an Oracle 10g enterprise which amounts up to $40,000. Because of these obstacles that companies are reverting to open source database solutions which is free. That’s when MySql gained its popularity. Although MySql lacks some enterprise capabilities, (well, some that are not being used or needed by the company) its free. This means a lower cost on the company’s side. Over the past few years this area of business is being dominated by MySql, Firebird, MS Access and Postgress. Not until now. Microsoft has just released last November 2005 its’ upgrade to the age-old MSDE (Microsoft Desktop Engine) the free database engine of Sql2000. It’s called SqlServer Express Edition. What about Oracle? You remember Oracle don’t you? Well, Oracle is currently the leading Database choice for enterprise applications just like SAP. With Oracle’s power come certain drawbacks just like the difficulty installing it. I personally experienced this when I was installing Oracle 9i on a development machine. It took me nearly 30 minutes to figure out on what I was doing. I think this is the real edge of SqlServer over Oracle, simplicity. I guess this edge is becoming thinner now. Oracle has just released its new product that is very similar (or should I say a copycat) to SqlServer Express. And guess what it’s called? Oracle 10g XE (Express Edition). Quite similar indeed! Well, Oracle XE is supposed to get rid of the complexity of usage of an Oracle database. For instance, the installer engine of Oracle which is the Universal Installer has been dropped off. Was I glad to hear that. Oracle XE is also a free database engine that caters mid-size solutions. For the simplicity of this blog I’m going to discuss Oracle XE and hopefully compare it to SqlServer Express. I’m going to drop-off MySql and other database engines for I am not using it. And in my opinion only these two are on the same level. The Oracle XE could be also termed as a lightweight Oracle Database. It’s easier to install manage and configure. You might be wishful thinking if you think that it has no limitations. Well, the limitations as I view it are not that of a big deal. Here are the lists of limitations: 1. Could only store for up to 4 GB of Data. 2. Could only use one processor (Although it can be installed on PC’s with multiple processors but it would only use just one processor) 3. Could only use 1 GB of memory. See, no big deal at all. SqlServer Express also has the same limitations with Oracle XE. So here comes the question, what to use? In my opinion many mid-sized database users are now using SqlServer Express, so why bother upgrade? I haven’t seen any mid-sized database requirement that Oracle could provide but SqlServer cannot. So sticking with your current technology isn’t such a bad thing. But if your starting to learn Database systems, or have plans being an Oracle DBA someday, then I suggest using Oracle XE. In my case, I’ve been using SqlServer since its 2000 version. So I guess upgrading would really hurt me. But currently I’m still downloading the Oracle XE package. I’m pretty quite interested about this product for I am really impressed with the performance of Oracle. The SqlServer IDE is very superb that I doubt I’m gonna to shift to Oracle XE anytime soon. But for you .Net aficionados, you’ll have a treat with this. Coz Oracle XE can now be configured using Visual Studio. There is a tool for .Net that enables this. The downside problem that I can see here is that the tool is currently on its Beta. And another issue was it couldn’t be installed on any Express editions IDE. Well I’ll still be trying it and maybe at long last I would be convinced on using Oracle.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:  
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Record Paging in SQL Server

Monday, 10 April 2006 15:04 by admin
One of the most common problems during a development of a database application is displaying large amounts of data. Fetching all of the data from your server and displaying it directly in your application is not a very good idea. Coz fetching large amounts of data could clog your server or at worse makes your application non-responsive.
 
A more common way of solving this problem is letting the user query the data first before displaying it. This would minimize the data being displayed and hence would lessen the memory consumption of your application. But what if the user really needs to browse all of the data in your table(s)? A very efficient way to solve this is by paging your data. Paging of data works in a way that you limit the view of your user. A perfect example of data paging is the Google search engine. Once you issue a query into the database only a limited SET of data is being returned per view. You can the move to the other page to see the next results.
 
In the VB6 days this is done quite easily, coz the recordset object directly supports paging through its CacheSize, PageSize and PageCount properties.
 
 
As you may have now noticed, ADO .Net is very different with its predecessor (ADO). Since the loading of your data greatly depends on the interaction between DataAdapters  and Datatables the ability of data paging should be done before the DataAdapter loads your data in the Datatable. Which gives you no choice but to use sql server side code to do this.
 
I have a friend that is an avid user of the mysql database. And I found out through him that you can do data paging through sql-scripts in mysql. But sadly, I can’t seem to find its equivalence in Sql Server.
 
Ok, don’t give up your hope on sql server and jump directly to mysql for I have found a workaround for this.
 
Before discussing the methods used to achieve data paging through sql server. I must say first that this is just my idea. This method doesn’t indicate that it’s the only way to achieve this. I’ve not yet tested it on very large databases, though I’ve tested it partially.
 
Let’s start then.
 
In the MSDN forums, a lot of users have been asking this question. And most of their answers suggests to use the TOP keyword in sql server. Well, its not entirely effective since the top keyword only returns the first number of records that you wish to query. After that, you wouldn’t be able to get the next SET.
 
To be able to get the next set we must have a record counter or a way numbering our records. You can’t achieve that by using an auto increment field coz this field would not be in order when deletions are made in your table. The numbering should occur upon querying the data. Here’s a solution that I’ve come up with:
 
--Create a View
SELECT     TOP (100) PERCENT COUNT(*) AS recnum, a.CustomerID, a.TerritoryID
FROM       Sales.Customer AS a INNER JOIN
                      Sales.Customer AS b ON a.CustomerID >= b.CustomerID
GROUP BY a.CustomerID, a.TerritoryID
ORDER BY a.CustomerID
 
-- You can now select your data this way:
SELECT * FROM vw_test WHERE recnum BETWEEN 100 AND 110
 
Upon testing this, I noticed that it was a little bit slow. It executed for 1:15! By the way the database that I used this query to is the Answerworks database. The table contains 19,000+ records.
 
I know that the sql script was not that efficient. So I tried another way using a stored procedure. I numbered my records by creating a temporary table with an autonumber field. Here’s the script:
 
CREATE PROCEDURE sp_test
      @start int,
      @end int
AS
BEGIN
      DECLARE @tmpTable TABLE (
            recnum int identity,
            CustomerId int,
            TerritoryId int
      )
     
      INSERT INTO @tmpTable(CustomerId, TerritoryId)
      SELECT CustomerId, TerritoryId FROM Sales.Customer
 
      SELECT * FROM @tmpTable WHERE recnum BETWEEN @start and @end
      ORDER BY recnum
END
GO
 
-- You can use it this way:
EXECUTE sp_test 100, 110
GO
 
To my surprise it executed only at 25 seconds. Although it’s a little bit slow but at least it has greatly improved its performance compared to my view approach.
 
I guess you have the final say on what approach you are going to use. But as you choose, take into consideration the length of the code that you are going to do vs. the number of records that you are trying to process.
 
Either you choose method 1 or 2 the results of these could then be loaded into your datatable. You can then just change the limits (start, end) of your parameter to get the pages that you want your user to view to ease the burden from your application.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:  
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed