Business Intelligence, SQL Server, SQLServerPedia Syndication

Rated R (A Teaser)

How many lines of TSQL codes and Window Functions you need to come up with this?

RWithSQLServer2012

With R, it takes about 2 commands:

> order <- as.matrix(sqlFetch(ch,"SalesDetails")
> summary(order)

To give you an idea, I prepared the dataset into a view like this:

CREATE VIEW SalesDetails
AS
SELECT
 soh.OrderDate AS [Date],
 soh.SalesOrderID,
 ppc.Name AS Category,
 pps.Name AS Subcat,
 pp.Name as Product,
 SUM(sd.OrderQty) AS Qty,
 SUM(sd.LineTotal) AS LineTotal
FROM Sales.SalesPerson sp
 INNER JOIN Sales.SalesOrderHeader AS soh
 ON sp.BusinessEntityID = soh.SalesPersonID
 INNER JOIN Sales.SalesOrderDetail AS sd
 ON sd.SalesOrderID = soh.SalesOrderID
 INNER JOIN Production.Product AS pp
 ON sd.ProductID = pp.ProductID
 INNER JOIN Production.ProductSubcategory AS pps
 ON pp.ProductSubcategoryID = pps.ProductSubcategoryID
 INNER JOIN Production.ProductCategory AS ppc
 ON ppc.ProductCategoryID = pps.ProductCategoryID
GROUP BY ppc.Name, soh.OrderDate, soh.SalesOrderID, ppc.name, pps.Name, pp.Name,
 soh.SalesPersonID

And, that’s it. I just fed that view to the R engine and it summarized the dataset just by using those two commands.

This is not the perfect dataset to test with R.

I’d love to dig deeper into R because of its powerful analytical features.

What is R?

“R is a language and environment for statistical computing and graphics.”

If you’re into statistics, linear/non-linear modelling, or simply want to try another tool to analyze your data warehouse, give R a shot.

If you want to start digging with R, Ted Malone ( b | t ) has a nice introduction to using R with SQL Server 2012. Get more information about R on the R Project website.

Standard
SQL Meme, SQL Server, SQLServerPedia Syndication

T-SQL Tuesday #31 – Logging

T-SQL Tuesday #31 - LoggingThis month’s T-SQL Tuesday is hosted by Aaron Nelson (@SQLvariant | Blog). The topic is about logging. Many will talk about their logging strategies with their SQL Server infrastructure. Many will show us ways they do their day-to-day logging. And many will offer tips and tricks to expert logging.

According to Aaron, we’re not constrained to talking about logging within just SQL Server. I am not the right person to talk about SQL Server logging; so, that rule encouraged me to participate in this month’s T-SQL Tuesday (my first).

I am tempted to write about all of the logging stuff I am doing in my personal life. If we take “logging” to mean making lists, tracking processes, and trailing work flows, my list will be in infinite loop.

Let me share how I track, or log, the blogs I want to read, or have read but want to keep for reference, in my quest to gain and improve my SQL Server DBA skills. I know I am far down the scale and reading is one of the best tools I can afford to catch up.

Chrome Bookmark

I have a main folder called “SQL Server” to hold all blog links related to SQL Server. These links are categorized into different topics with each topic placed in their own sub-folder. My folder structure looks something like this:

SQL Server
> SQL Fundamentals
> SQL Dev
>> SSRS
>> SSIS
> Backup & Recovery
> High Availability
>> Replication
>> Mirroring
>> Log Shipping
>> Failover Clustering
> Security
> Performance Tuning
> Monitoring
> Troubleshooting
> SQL Tutorials
> SQL 2012
>> AlwaysOn Availability Group
> SQL Azure
> SQL Tools

It’s not a perfect system but it works for what I need.

Twitter Favorites

I also track the interesting links I found on Twitter by marking them as Favorite. If the link is something that I can use now or in the future, it goes to my Chrome Bookmark. More often than not, I “favorite” something to just read it later

Old-school Notebook

I am on a mission. I am on a quest for that elusive SQL Server DBA job I have been longing to have. Aside from blog reading, I purchased a handful of SQL Server 2008/2012 paperbacks and I have a list of books I still need to buy! I have some SQL Server books on my Kindle, too. For me taking notes is better than highlighting sentences. Yes, I agree that searching through pages in physical notebooks is difficult but I am comfortable with that. Hey, I’m a Moleskine fan!

Hacker News

I have become a Hacker News (HN) fan only last year. It’s my source of daily geek news. Where do you think I’m finding those interesting (well, some of them are) links I am posting on my Twitter stream? Want to know latest movement in the tech world? Yes, go to HN. My upvoted links are stored in my “saved stories” and all the links I submitted are in my, well, “submission”.

I promise that I will post about real SQL Server logging next time.

Standard
SQL Server

Getting started with SQL Server on private cloud

I have been invited to a private beta of SQLDirector by ScaleGrid. “SQLDirector is a MS SQL as a Service (SaaS) solution for the private cloud.” It is a software solution for your private cloud or virtualization infrastructure.

SQLDirector makes the deployment of SQL Server on virtual infrastructure quick and easy by bypassing the complexity of configuring virtualized environment with intuitive single-click wizard.

“SQLDirector allows easy one click provisioning, consolidation and virtualization of database instances.”

Each SQL Server instance is deployed to a machine pool that is mapped, in my case, to a VMWare vCenter ResourcePool (vCenter Server 5.0). According to their website, “The ScaleGrid solution works across heterogeneous virtualization platforms like VMware, Microsoft System Center Virtual Machine Manager (SCVMM), Citrix XenServer etc.”

In the beta, I only have two options for my machine pool mapping: System Center Virtual Machine Manager 2012 and VMware vSphere 5.0.

Scale Grid is generous enough to provide me my own machine that I can access via VPN (thanks to Ankit!).

Let me walk you through the the Scale Grid software. I am creating a SQL Server 2012 database in this demo:

Single Click Wizard

Scale Grid Database Wizard

SQL Server Instance (beta only supports New instance)

SQL Director Instance creation

Setting up Authentication

SQL Director Authentication

Database Setup

SQL Director Database Setup

High Availability Setup (not available in beta)

SQL Director provides High Availability

SQL Director Provisioning Steps

Scale Grid SQL Director Provisioning Steps

Machine/Instance Information

Virtual Machine created by Scale Grid

SQL Server Status on SQL Director

SQL Server Status on SQL Director

Accessing The SQL Server On The Private Cloud

Connecting To The Cloud SQL Server on SQL Director

SQL Server On Private Cloud via SQL Director

Standard