SQL Server 2012 Performance Dashboards – Some Real-Time Snapshots


Following are some real time SQL Server 2012 Performance Dashboards, taken from a real time SQL Server 2012 environment:

HOME PAGE

 

EXPENSIVE QUERIES – CPU

 

EXPENSIVE QUERIES – DURATION

 

and much more…

It’s a great set of reports for every SQL Server DBA to understand his/her SQL Server environment.

VAIDY

Microsoft SQL Server 2012 – Performance Dashboard Reports


In March 2012 (precisely 6th March 2012), Microsoft made available SQL Server 2012 Performance Dashboard Reports which can be used to identify whether there is a current bottleneck on the system, and if so, capture additional diagnostic data that may be required to resolve it.

More information on this can be read from the download page: Microsoft SQL Server 2012 Performance Dashboard Reports.

One point worth to be highlighted is that this doesn’t require Reporting Services to be installed.

It’s a very crucial and important tool for any database administrator.

VAIDY

Formatting SQL Procedures


Have you ever opened a standard GP stored procedure?

I do it at least on a weekly basis and have always found it impossible to read as it is. So I end up aligning the procedure first and then read it to understand the logic.

Not anymore. David has shared information on some portals which does this in seconds and give us an aligned code.

Standing out from his list is Poor SQL, from what I learned from my usage.

And there is a plugin for SSMS which does this from within SSMS. This tool is called SSMS Tools Pack.

Happy aligning.

VAIDY

Introducing Microsoft SQL Server 2012 – Free eBook


That’s a great news for those who would love to know more about Microsoft SQL Server 2012.

Microsoft Press has released a FREE EBOOK detailing SQL Server 2012. And it has got 288 pages full of information and it’s free and we have several options of the file type; EPUB, MOBI & PDF.

Get your copy now and know what it is in Microsoft SQL Server 2012.

VAIDY

Dynamics GP 2010 is compatible with SQL Server 2012


Mariano, in his new post, confirms that Microsoft Dynamics GP 2010 is compatible with SQL Server 2012. The post also has got links to both CustomerSource and PartnerSource.

This is a good news, since SQL Server 2012 will precede Dynamics GP 2013, which means customers would be first upgrading their SQL Server first.

SQL Server 2012 has got tremendous amount of features that are going to be crucial in future.

So let’s gear up for some serious upgrades.

VAIDY

SQL Tip: Find Table(s) Having A Particular Column


This SQL query is my savior for a long time now. Thought I would just share it with all budding SQL developers.

Q: How to find the table(s) which contain a particular column which I know?
A: Below is the query that would do the trick.

SELECT name 
FROM sys.objects 
WHERE object_id IN 
(
SELECT object_id 
FROM sys.columns 
WHERE name = [columnname] –Column which you would want to locate
)

This query will return all tables which contains the specific column. And this query also would save your time immensely.

VAIDY

SQL Server Services – Do Not Set To "Automatic (Delayed Start)"


I am not sure anyone else would have faced this issue. But I did couple of days back that almost killed my system.

I formatted my system and built it from scratch, that obviously also included SQL Server. I always set SQL Server services (SQL Server Database Service, SQL Server Agent, SQL Server Reporting Service, etc.) to Automatic. This means, when OS gets booted, all these services will also get started before we see Desktop.

I read a KB article on MSFT site, which explained each of Application Startup options; Automatic, Automatic (Delayed Start), Manual, Disabled.

Difference between Automatic and Automatic (Delayed Start) is that Automatic option lets the concerned service to get started immediately after OS boots. Automatic (Delayed Start) option lets all services of OS to get started first and then after a brief delay starts the concerned service.

After reading above, I decided to set SQL Server Services startup option to Automatic (Delayed Start). And that proved disastrous.

Restarting the system never progressed beyond STARTING WINDOWS. And when I switched off system forcibly and rebooted it, system asked me to either BOOT SYSTEM NORMALLY or RUN SYSTEM STARTUP FAILURE DIAGNOSTIC.


Selecting either of above yielded nothing. I had no other option than to reinstall OS.

Moral of this bitter story: Never set Automatic (Delayed Start) as Startup option to all SQL Server Services. If you don’t want these services to be started immediately when OS boots, then set it up to Manual.

VAIDY

Getting Month Numbers between two dates in T-SQL


I literally had to spend around an hour to crack this code, with some little help from my best geek friend, GOOGLE, of course.

Issue is this: I wanted to get Month in Numbers (Jan = 1, Feb = 2, etc.) that exist between two dates. For instance, if my date range is 1-Jan-2011 to 31-Mar-2011, then I should find and retrieve the months Jan, Feb and Mar as 1, 2 and 3 respectively.

After much much toiling and reading some stuff online, the following is what I got for myself:

—–

;WITH Numbers (Number) AS
(SELECT ROW_NUMBER() OVER (ORDER BY OBJECT_ID) FROM
sys.all_objects)
SELECT MONTH(DATEADD(MONTH, Number – 1, ‘2011-01-01’)) Month_Number
FROM Numbers
WHERE Number – 1 <= DATEDIFF(MONTH, ‘2011-01-01’, ‘2011-03-31’)

—–

IMPORTANT: Make sure that you have more than 12 records in sys.all_objects table, which by default SHOULD have.

I hope this code piece is useful for some who have got similar requirement.

VAIDY

Last Sale By a Customer & Item – Victoria’s SQL View


Victoria‘s latest SQL view retrieves the last sale by customer and an item. With little tweaks here and there, this SQL view will serve us immensely to show various information pertaining to Customer and/or Item sales.

Thanks Victoria for this view. This has come especially when I am working on some dashboards and reporting. It’s surely going to help me deriving some important reports.

VAIDY