Thursday, April 24, 2014 Register   Login

This site uses DNS Made Easy. Use it for reliable and professional DNS services.

RSS Feeds
Blog

Databases

 

Jan
12

I'm getting out software development as a career. I still wanted to stay in Information Services. Fortunately, I found my new home in Business Intelligence. Specifically, I'm working with SQL Server Integration Services (SSIS).

Staying competitive in software development has become harder and harder each passing year. By competitive, I mean being able to have a job to practice the craft. My commute (45 minutes each way) and my energy levels have caught up with me, so I can't stay competitive (in the context of this post). The churn is crazy high, and requires even more increasing time outside of work to stay relevant. It used to be that you could concentrate on specific technologies, but that's no longer the case.

I've found that Business Intelligence is a lot more sedate when it comes to technologies, and it's much easier to stay competitive. This means that my focus will be in data warehousing, and Microsoft technologies related to this. So far the main technologies are SSIS, SSRS, and SSAS. I can still use my development experience to deal with custom and edge cases.

I'm much happier with this transition. I can truly feel that my work-life balance is back to where it needs to be.

So effective immediately, I'm cutting back on my development pet projects. I'll update a few tools here as time permits. My main efforts will be directed at getting WheelMUD to version 1.0. Then, I will retire from development in the public eye.

posted @ Thursday, January 12, 2012 12:29 PM by Hector Sosa, Jr

Posted in: Personal, Databases

Actions: Tweet This  Share on Facebook  Share on LinkedIn  Emakl  Permalink  del.icio.us
Apr
27

I've been working a lot more with LINQ2SQL and LINQ2Entities lately, and I ran into my first issue at the end of last week. I couldn't figure out why null parameters were causing the query to return strange results.

The original query looked like this:

   List<MenuLayoutDataEntity> ret = (from c in _Context.tblMenuLayouts
                                     where c.ConceptID == entity.ConceptID
                                     && c.ItemID == entity.ItemID
                                     && c.MarketID == entity.MarketID
                                     && c.DepartmentID == entity.DepartmentID
                                     orderby c.SortOrder
                                     select new MenuLayoutDataEntity()
                                     {
                                         MenuID = c.MenuID,
                                         ItemNamePOS = c.ItemNamePOS,
                                         ItemID = c.ItemID.HasValue ? c.ItemID.Value : -1
                                     }).ToList();

Sometimes, the MarketID and DepartmentID would be null, and that's what was causing the problem. After some Googling, I found that I need to enclose the equality using the Equals method in the object class. Here's the query using Equals:

 
   List<MenuLayoutDataEntity> ret = (from c in _Context.tblMenuLayouts
                                     where c.ConceptID == entity.ConceptID
                                     && c.ItemID == entity.ItemID
                                     && Equals(c.MarketID, entity.MarketID)
                                     && Equals(c.DepartmentID, entity.DepartmentID)
                                     orderby c.SortOrder
                                     select new MenuLayoutDataEntity()
                                     {
                                         MenuID = c.MenuID,
                                         ItemNamePOS = c.ItemNamePOS,
                                         ItemID = c.ItemID.HasValue ? c.ItemID.Value : -1
                                     }).ToList();

Unfortunately, this only works for LINQ2SQL, and this query is actually a LINQ2Entities query. So back to Googling. I finally found a hint in a post over at StackOverflow. Apparently, there's is a bug in the LINQ2Entities parser when trying to use IS NULL functionality in the where clause. The solution was to check the value on the entity class, and then select a specific query. Here's the results that actually gave me the results that I wanted:

 
            List<MenuLayoutDataEntity> ret = null;
 
            // Check if this is a store item, i.e. Departmental
            if (entity.MarketID.HasValue && entity.DepartmentID.HasValue)
            {
                ret = (from c in _Context.tblMenuLayouts
                       where c.ConceptID == entity.ConceptID
                             && c.ItemID == entity.ItemID
                             && c.MarketID == entity.MarketID
                             && c.DepartmentID == entity.DepartmentID
                       orderby c.SortOrder
                       select new MenuLayoutDataEntity()
                       {
                           MenuID = c.MenuID,
                           ItemNamePOS = c.ItemNamePOS,
                           ItemID = c.ItemID.HasValue ? c.ItemID.Value : -1
                       }).Distinct().ToList();
            }
 
            // Check if this is a market item, i.e. MarketID is not null
            if (entity.MarketID.HasValue && !entity.DepartmentID.HasValue)
            {
                ret = (from c in _Context.tblMenuLayouts
                       where c.ConceptID == entity.ConceptID
                             && c.ItemID == entity.ItemID
                             && c.MarketID == entity.MarketID
                             && c.DepartmentID == null
                       orderby c.SortOrder
                       select new MenuLayoutDataEntity()
                       {
                           MenuID = c.MenuID,
                           ItemNamePOS = c.ItemNamePOS,
                           ItemID = c.ItemID.HasValue ? c.ItemID.Value : -1
                       }).Distinct().ToList();
            }
 
            // Check if this is a global item, i.e. both MarketID and DepartmentID are null
            if (!entity.MarketID.HasValue && !entity.DepartmentID.HasValue)
            {
                ret = (from c in _Context.tblMenuLayouts
                       where c.ConceptID == entity.ConceptID
                             && c.ItemID == entity.ItemID
                             && c.MarketID == null
                             && c.DepartmentID == null
                       orderby c.SortOrder
                       select new MenuLayoutDataEntity()
                       {
                           MenuID = c.MenuID,
                           ItemNamePOS = c.ItemNamePOS,
                           ItemID = c.ItemID.HasValue ? c.ItemID.Value : -1
                       }).Distinct().ToList();
            }

Very annoying, but at least I know how to handle this. Hopefully this will help another soul out there.

posted @ Wednesday, April 27, 2011 11:32 AM by Hector Sosa, Jr

Posted in: Code, Databases

Actions: Tweet This  Share on Facebook  Share on LinkedIn  Emakl  Permalink  del.icio.us
Jan
17

I just joined the SQLServerCentral group at LinkedIn, and already found a great freebie. Microsoft has a downloadable version of "Introducing Microsoft SQL Server 2008 R2" over at http://blogs.msdn.com/b/microsoft_press/archive/2010/04/14/free-ebook-introducing-microsoft-sql-server-2008-r2.aspx

I realized that I hardly post stuff about databases, which is one of the things that I'm heavily into.

posted @ Monday, January 17, 2011 7:58 PM by Hector Sosa, Jr

Posted in: Databases

Actions: Tweet This  Share on Facebook  Share on LinkedIn  Emakl  Permalink  del.icio.us
  
Terms Of Use | Privacy Statement | SystemWidgets
Copyright 2002-2013 by SystemWidgets
Google Analytics Alternative