Fraser Dowall

Rants and musings of a B.I. Professional

About

Proin accumsan urna in mi. Aenean elementum egestas tortor. Donec neque magna, auctor a, dapibus sit amet, facilisis sit amet, ligula..

OK so Google has had their street level view for a while, and it’s pretty awesome. I’ve used it to find things a lot. Well one advantage of being second to market, is the ability to make a leap forward. Google has done well to stay ahead of the leap froggers, but after seeing this demo. Well, see for yourself.

+1 Microsoft

http://research.microsoft.com/en-us/um/people/kopf/street_slide/

–Start of Last week
Select

dateadd(wk,-1,
(dateadd(yyyy, datepart(yyyy,
dateadd(weekday,1-datepart(weekday, getdate()),getdate()))-1900, 0)
+ dateadd(dy, datepart(dy,
dateadd(weekday,1-datepart(weekday, getdate()),getdate()))-1,0))
)

– End of last week

Select
dateadd(day, DateDiff(day, 0,

dateadd(wk,-1,dateadd(yyyy, datepart(yyyy,
dateadd(weekday,7-datepart(weekday, getdate()),getdate()))-1900, 0)
+ dateadd(ms, -3,
dateadd(dy, datepart(dy,
dateadd(weekday,7-datepart(weekday, getdate()),getdate())),0) ))
), 0)

Donald Farmer Leaves Microsoft

January 31st, 2011

Donald Farmer has been the lead of Microsoft BI for a while now, and he was the one who had been showing us the path for new products and best practices for BI. His vision will be surely missed. I’ve been so busy I missed this bit of news until this am.

http://donalddotfarmer.com/2011/01/05/a-new-beginning/

select ‘select ”’+Table_Schema +’.'+ Table_name + ”’ as TableName, count(1) as Row_Count from ‘+Table_Schema +’.'+ Table_name
from INFORMATION_SCHEMA.TABLES

TSQL End of Current Month

July 8th, 2010

select dateadd(m, datediff(m, 0, dateadd(m, 1, getdate())), -1)

Running totals are one of those things that are used a lot in reporting, and custom running totals end up being used more than not. In this post we will have a quick code to show row numbers by custom increments, so hidden rows and groups etc, will not effect this. I Modified my standard Running Total code to simplify this when rownumber() was failing for me.

Step 1 : report code

public dim RunningTotal as int32 = 1

public function IncreaseRunningTotal(a as boolean) as boolean
if a then
RunningTotal= 1
return true
end if
RunningTotal= RunningTotal+ 1
return false
end function

Step 2 Increment :

=Code.IncreaseRunningTotal( False)

Step 3: reset

=Code.IncreaseRunningTotal(true)

Step 4 Display

=Code.RunningTotal

SIMPLE! :D

TSQL Date Forumlas

June 14th, 2010

—-Last Day of Previous Month
SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE()),0))
LastDay_PreviousMonth
—-Last Day of Current Month
SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE())+1,0))
LastDay_CurrentMonth
—-Last Day of Next Month
SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE())+2,0))
LastDay_NextMonth

dateadd(m, datediff(m, 0, dateadd(m, 2, @MyDate)), -1);

SELECT DAY(DATEADD (m, 1, DATEADD (d, 1 – DAY(GETDATE()), GETDATE())) – 1)

 

Microsoft has the gloves off and is ready to rumble.

It proudly shows 6 compelling reasons to switch to SQL Server from Oracle on their Microsoft in Government site.

http://www.microsoft.com/industry/government/products/server/sql2008.mspx#WhySwitch

 

Has Microsoft really surpassed Oracle?

 

Well their site claims so..:

  SQL Server 2008 Oracle

Performance and Scalability

1

1

Business Intelligence

1

Total Cost of Ownership

1

Stronger Partner Ecosystem

1

Better Together with Microsoft Office

1

Security

1

 

Total

6

1

 

Round 2 of the Database wars appears to be on. Microsoft appears to have taken the first shot!