Determine number of active connections to each database in SQL Server

by Xavier Comments: 0

So I am taking databases offline and I need to find out which ones have active connections to them. People usually do a

sp_who

However that brings a lot of info that I don’t need. I prefer to use this query so I see the DBs with number of connections!

SELECT
DB_NAME(dbid) as DBName,
COUNT(dbid) as NumberOfConnections,
loginame as LoginName
FROM
sys.sysprocesses
WHERE
dbid > 0
GROUP BY
dbid, loginame
;

Brilliant query!

Change owner of a Microsoft SQL Server database

by Xavier Comments: 0

We had a spaghetti of database owners so I decided to get this straightened out. How to do it? Simple!

– Open New Query in SQL Server Management Studio in the database that you want to change the owner
– Run EXEC sp_changedbowner ‘domain\owner’
– Wait for Command(s) completed successfully.

As simple as that!

How to throttle Google Drive

by Xavier Comments: 0

So Google Drive’s price hits rock bottom killing everyone else, $2 for 100GB and $10 for 1TB monthly. Should I stay or should I go?

So I have explained before why Google Drive sucks, but now at this price the name of the game changes. So there were two blockers for me:
– No throttling which dropbox does brilliantly
– No LAN sync

Ok, so Google Drive is still a B product against the competition and can’t do LAN sync. But there is a way to do throttling. Not built in, but it lets me use Google Drive without being shot (kind-a) by IT

Get NetBalancer by SeriousBit. I am not affiliated with them in any way but they have a killer product!

You can throttle your processes
Limit

And check this out. This is instant gratification for a geek like me!
Monitor and throttle your bandwidth

It even has a very small gadget plus another one in the task bar just with the ups and downs.
Summary

Now only one thing pending, LAN sync! C’mon Google! Make it worth it!

One detail about LAN Sync: Nothing to do at this point. Google Drive is even so dumb that if you copy the files first it does not recognize that they are duplicate and creates copies

Developers: Think about consequences, implications, performance and related

by Xavier Comments: 0

Today I find myself removing a stored proc from our dbml because it is no longer in use. This stored proc updates the document information to be exported.

I check our source code and indeed no one uses it. So I go ahead and remove it. Is that the end of the story? Usually it is, but I decided to use a bit of common sense to find out if this is the last step or no. It wasn’t. Let me explain and get to the moral of the story quickly:

– We have a requirement to export the information of up to several tens of thousands of documents into Excel/Word/XML in a single go.

– We used to need to make sure that the document information is up to date, and given the source is in XML and XPath is rather slow, we built an intermediate SQL Server table to be able to have speedy exports.

– We made a change and now information is always up to date in the intermediate exports table, however the code that CHECKS if the information is up to date was not removed.

– So the info is not updated as it is already up to date, but we are still checking if we should ACTUALLY DO THE UPDATE. The code is still there.

What does this translate into? An unnecessary and performance degrading step. We need to check to determine if thousands of documents are up to date (and twice but this is another story) when they already are. This means there are two queries that we could easily avoid and save time as they add zero value but take several minutes to execute.


Moral of the story: when making a change don’t focus only on the change, focus also on the side effects of a change.

This should be a rule of common sense for all developers.

Para vivir en Costa Rica hay que ser millonario!

by Xavier Comments: 0

Y pasa con todo. La regla general es que si vale $50 en USA vale 50 000 colones en Costa Rica qie son basicamente el doble. Que aguevado vivir en un pais tercermundista con salarios variables pero no tanto como pais de primer mundo y aun asi pagar todo a precio “premium”. Este es solo un ejemplo de hoy:

El alto costo de la vida en CR

Conference calls – sounds familiar?

by Xavier Comments: 0

Conference calls can be a pain. Nothing replaces face to face conversations however cost can be prohibitive sometimes.

Does this sound familiar?

or
http://conferencecall.biz/

And if it does, then take a bit to look at this site and identify if you are a freelancer, consultant or simiar: http://clientsfromhell.net/

And of course fun for geeks: http://thedailywtf.com/

My take on meetings – Part 2

by Xavier Comments: 0

A couple of years ago I wrote what I thought about meetings. Today I will add another thought

If you have a 30 meeting where there are 10 people sitting down with you, this is not actually a 30 minute meeting. It is instead a 30 min * 10 people = 5 hours loss of potentially very productive time.

Moral of the story: keep meetings short and only invite those who really need to be there.

Problem with geeks deciding on user experience

by Xavier Comments: 0

I got this today from Skype (which of course is from Microsoft because its the way they think). I hate it. Why? Because a geek in Redmond decided that it was a brilliant idea to mine as many contacts as possible from a user’s inbox and then add them on Skype! Brilliant, right?

No.

Problem: in an inbox I don’t only have friends. I have co workers and people I don’t really like. Let me add my friends one at a time, choosing who to add and who not to add. Don’t force me.

skypeforce

PS: It is a very common practice across the board, but one I loathe.

Mis land rovers

by Xavier Comments: 0

Algunas de mis fotos preferidas de Land Rover

Installing Mac OS X Mavericks vs Microsoft Windows 8.1

by Xavier Comments: 0

Steps to update Mac OS X Mavericks
– Open App Store in your Mac, type in Mavericks, click install and enter your credentials.
– Wait for the download, machine reboots and you are done!

Excellent user experience, done in a few minutes and just wait a bit for the download and install. Kudos to Apple.

Steps to update from Windows 8 to 8.1
– Google how to update, read the instructions
– Find out you need to do the updates (to Maps, Skydrive, …) before actually installing
– Read in the article that when you open the Store there will be a huge billboard telling you to update
– Open the Windows Store and find NOTHING
– Search for “8.1” and the only thing you get is all kinds of “My app for 8.1”
– Google again to see what the hell is going on
– Finding this article: http://windows.microsoft.com/en-us/windows-8/why-can-t-find-update-store
– Getting upset because Microsoft still does not get it that people want a simple user experience

I hate updating Win 8.1

I hate updating Win 8.1