SQL Server: ranking your data

This is the kind of query that kills some servers – ranking.

It’s a bit hard to make programmers understand how important the performance of their code can have a big impact on server speed – they all seems to think that throwing more hardware will solve all world’s problems… unfortunately it does not work that way.

So, after the app is completed and tested and validated by the manager (with a small data-set, of course), it goes live. After a few thousand records are inserted, things start to slow down, and it is exactly the report that the manager will look everyday. If this is familiar to you, take a look at the hints and techniques in this article: Nasty Fast PERCENT_RANK from SQL Server Central folks.

It’s not just the ranking itself, but all types of queries and data manipulation shown there that may help you. And the ideas work in all database engines, of course changing the language to the one you like.

and happy coding!


Posted in BI, MongoDB, MySQL, Oracle, SQLServer | Tagged , , , , , | Leave a comment

Some fancy BI stuff: SSIS training, Data Tools add-ins and BIML academy

A few days ago I posted a link to one BIML introduction webcast. Now I now it will be a series of webcasts this week, it’s a great oportunity to learn more about it! Stay tuned and subscribe to the remaining days of the BIML ACADEMY. Recordings on previous days will be available too.

While we are on BI topic, you can get yourself started on the Stairway to Integration Services articles teaching how to use SSIS. These series of articles are a great idea from the guys at SQL Server Central. SSIS (Integration Services) is a great tool to Extract, Transform, and Load (ETL) data and can be used on various kind of projects and reports.

A final note on the topic is that this tool allows you to expand its capability. BIDS Helper is a great set of add-ins that really expand the SQL Data Tools and makes your life easier. Codeplex.com has some really nice projects shared and is worth a look.

Bonus content: as we are talking about additional stuff for SQL 2012, you might want to take a look at Microsoft® SQL Server® 2012 SP1 Feature Pack (no links for SP2 and SP3, sue MS). Also the SQL Data Tools itself should be installable over this direct download for 2012 (no need to get a full SQL Server ISO). For newer versions check this page (match it to your Visual Studio version just for safety). You can try to apply SQL Server® 2012 Service Pack 3 (SP3) to it, but I’m not sure if it will work. Of course, install your SQL Server Management Studio of choice first (I recomend that you stick to the version your servers currently run at work. At home use the newer to learn it. Previous versions are available here or at the SQL2012 SP3 page). You might have a bit of trouble with 32bit vs 64 bit SSIS issues, but it should be easy to overcome.

PS: sorry for so much links in just one post. Microsoft really makes a confusion with their development tools, but it seems they are trying to consolidate that.

PS2: you might experience some compatibility warnings after installing the Data Tools for VS2012. Please update this KB2781514: (source). Also please install in this order: SSMS, Data Tools, full VS suite (if you are a developer).


Posted in BI, SQLServer | Tagged , , , , | Leave a comment

How to install DSA.MSC on Windows 7 and Server 2008 / 2012

For Windows 7 you will need to download a package from Microsoft: Remote Server Administration Tools for Windows 7 with Service Pack 1  . Follow the great instructions in this link: http://tweaks.com/windows/40075/install-group-policy-and-ad-tools-on-windows-7/

For Windows Server 2008 and 2012, it’s just a matter of adding the feature via the “Add Roles and Features Wizard”. Also some detailed instructions are here: http://www.peppercrew.nl/index.php/2012/07/good-old-dsa-msc-on-windows-server-2012/


Posted in Windows | Tagged , , , | Leave a comment

SSIS / Data Tools compatibility between 2014 and 2012

Well, to be simple: there is no backwards compatibility when you create a package in SQL Server 2014 Data Tools (formerly SSIS/BIDS). 2014 files only run on 2014 servers. 2012 on 2012, and that’s it.

Microsoft acknowledge this issue but as SQL 2016 is the current version, there is no hope for 2014 users. So you have to stick to 2012 tools if your servers are living in that version. I have lived on 2008 long enough, so that’s not gonna be a problem, but for anyone trying to show new things to the boss in order to make the company bite the bill for a new version, this is bad news.

There are a couple of work-arounds, of course: Vanie Castro found some stuff inside the XML files, and Verena expanded upon it.

By the way, MS should make it easier for us to sell their products, but they don’t. Maybe someday.


Posted in BI, SQLServer | Tagged , , , | Leave a comment

BIML first steps

BIML stands for Business Intelligence Markup Language. It adds some things on top of SSIS (SQL Server Integration Services, now called SQL Data Tools, or BI Development Studio, or even DTS – Microsoft should really make up their mind and stop changing this product name).

Its used to automate and simplify some tasks in the BI world, with a strong focus to save time creating and maintaning SSIS packages used in the ETL steps of any BI project. You know, SSIS is not strictly for use with SQL Server, it can read any data source and write to any other DB engine too. So even if your project is not related to SQL directly, you can benefit of it.

I follow the folks from http://www.sqlservercentral.com/ and received the news of a free webinar to learn BIML. It’s available at the Biml Academy. It’s free and a great oportunity to learn it. The date will be May-09, at 01:00pm EDT.

You can read an introduction to BIML here. Go on. Subscribe now. Knowledge is never too much.

Link to webinar: http://andyleonardconsulting.enterthemeeting.com/m/JCNAMVF8



Posted in BI, SQLServer | Tagged , , , , , , | Leave a comment

SQL Server 2012 SP3 Management Studio Download

Aaaand we’ve got some news regarding the Management Studio download links for SQL Server 2012 Service Pack 3 (see last post about this here).

Microsoft released the Service Pack 3 for SQL Server 2012 on November/2015, so right now it’s a good time to get the latest SP and tools for it. With the development now focused at SQL 2014 and SQL 2016, this could be the final big Service Pack for SQL2012.

As before, the key is looking for the SP3 download page, and then select only the minimum file you will need. For most users, that will be “ENU\x64\SQLManagementStudio_x64_ENU.exe”. Some people may need the other packages, but those folks should know what they are looking for already. There goes the new link:

https://www.microsoft.com/en-US/download/details.aspx?id=50003 (no direct link this time, folks).


Posted in SQLServer | Tagged , , | Leave a comment

How It Works: SQL Server I/O Presentation by Bob Dorr

Once upon a time, in a server farm far far away… enough talk. I was researching some warning messages on my SQL boxes and came to this 2010 paper by one of the  Microsoft Customer Service and Support (CSS) SQL Support team members. It is a really great presentation about SQL Server IO needs and, well, how it works.


Read it, read it, read it.

ok, now cya!

Posted in SQLServer, Windows | Tagged , , , , | Leave a comment

Tips for Exam 70-462: make your labs using Azure trial

The complexity of certification exams is climbing up lately – up to the clouds. Gone are the days where a simple 3 VM lab was enough to try out every new tech release to newer versions of some product – SQL Server in this case.

Article: http://www.sqlservercentral.com/articles/certification/128503/
Read it, do it. Practice, practice, practice. You can even try some PowerShell on this setup.

Course: https://www.microsoftvirtualacademy.com/en-US/training-courses/administering-microsoft-sql-server-2012-jump-start-8259

You can try this too: https://technet.microsoft.com/en-us/virtuallabs (I will do it myself later).

You can always go the DIY route and use VMs on your home computer, but it is good to get a feeling for administering something in the cloud – there are clouds everywhere lately, really.

PS: but I will do it in my home too, of course, so I won’t loose my setup in case of rain…

Posted in Cloud, SQLServer, VMware, Windows | Tagged , , , , , | 2 Comments

MS SQL: New ways to test disk performance

Sometimes things get easier, better or simples. Actually we became spoiled to expect this kind of evolution from everything in the world, and this is not always the case. But sometimes it is. Jokes aside, a while ago I opted for simpler tools to do performance tests that are easier to translate into real-world examples, and recently one of these tools has got a revamp in functionality and this new and updated version is worth testing.

The tool is CrystalDiskMark, wich has been updated in version 4 to use a new framework to do it’s testing (Microsoft DiskSpd).

It’s good to be able to keep it simple, but if we need anything more detailed you can also go directly to the bones of it and use the new DiskSpd directly and with more control. This is a great article that I wanted to share with you, please take your time to read it and apply it to your database servers: http://sqlperformance.com/2015/08/io-subsystem/diskspd-test-storage



Posted in SQLServer, Windows | Tagged , , , | Leave a comment

Get all job steps in SQL Server

You never know when you will need to get all the jobs steps in a hurry. This is a great script for this situation.

Sufian's Diary

Someday you might need to see the steps of any specific job or find in which step of which job does a specific query is used. Confused!

Following query will show you all the steps of a specific job having a specific query in any of its steps.

FROM Msdb.dbo.SysJobs JOB
INNER JOIN Msdb.dbo.SysJobSteps STEP ON STEP.Job_Id = JOB.Job_Id
WHERE JOB.Enabled = 1
AND (JOB.Name = ‘%Job_Name%’ OR STEP.COMMAND LIKE ‘%Exec AnotherStoredProcedure%’)

View original post

Posted in Uncategorized | Leave a comment