Monday, November 9, 2009

Visual Studio vs ReportingService

Today I almost pulled my hair off again (well, what rests of it). I was having a local report that used to work until I added some fields in the stored procedure that was filling it. After wandering and thinking and checking the SP, I found this:

Monday, March 30, 2009

Visual Studio Editor

While working on a web site recently, I used Visual Studio 2008 for a small wizard in ASP.NET.

It was cool at the beginning, but it become really painful when, after a while, I was trying to update the tables on the page. Seems like Visual Studio is creating a lot of stupid style-sheets when you drag the table's rows or columns. Hilarious things, like very height rows of the tables, happen. When you try to resize the row back to it's normal size, no way. The only way I found was to manually edit the ASPX and delete the generated styles. And I'm not the only one having problems with it, a friend whom I am working with reported the same problem.

While I like Visual Studio for it's ease of use and clean interface, I found the way it deals with the wizard to be very...let's say at least uninspired. So, what can be done ?
1) Integrate really often, so if the things get messed up you can come back to a good version.
2) Manually edit the ASPX for small changes. It's much faster than trying to convince VS to work the way you'd expect.

Wednesday, January 14, 2009

Don't get over OVER

So I knew about over but didn't have the opportunity to use it every day. But today, I needed a query that would group the data by two criteria; for each group I have a number and then for each group I need the row with that number to be the MAX in the group by first criteria.

Like this: I have table T with Columns A, B and theNumber and I do a

SELECT A,b, sum(theNumber)

And from this I need the rows with the max sum(theNumber) per A

That resulted into

SELECT A, min(B), theNb FROM (
SELECT A, B, theNb, MAX(theNb) OVER (PARTITION BY A) maxim
SELECT A,B, sum(thenumber) as theNb FROM T
WHERE someCondition
) bb
WHERE theNb= maxim

instead of big subQueries and clumsy code