Finding out who is using my SQL Server 2008 database!

My last post was about taking databases offline, which if in use can be very problematic.

So before doing anything that can be interrupted if there is an open connection just run this:

CREATE TABLE #sp_who2 (SPID INT,Status VARCHAR(255),
Login VARCHAR(255),HostName VARCHAR(255),
BlkBy VARCHAR(255),DBName VARCHAR(255),
Command VARCHAR(255),CPUTime INT,
DiskIO INT,LastBatch VARCHAR(255),
ProgramName VARCHAR(255),SPID2 INT,
REQUESTID INT)
INSERT INTO #sp_who2 EXEC sp_who2
SELECT *
FROM #sp_who2
-- Add any filtering of the results here :
WHERE DBName <> 'master'
-- Add any sorting of the results here :
ORDER BY DBName ASC

DROP TABLE #sp_who2

Please note that sp_who2 is undocumented by Microsoft so it might change

Taking a database offline in SQL Server 2008 and avoid transition error message

Taking a database offline is a very simple task. Right click on it and select ‘Take offline’. However, if the database is being used at the moment the action will fail and your database may remain in limbo for a (sometimes long) while.

Msg 952, Level 16, State 1, Procedure sp_who, Line 79
Database ‘UATdb’ is in transition. Try the statement later.

Try this instead:
ALTER DATABASE UATdb SET OFFLINE WITH ROLLBACK IMMEDIATE

Why I ditched Google Drive and doubled Dropbox…

Simply because Google Drive is crap. Here is a list of things it did to me:
- No LAN sync, don’t know if already fixed but it is impossible to sync 100GB on each machine, and they are next to each other in the same LAN
- Duplicated my files, when I reformatted the computer and tried to install it again. Dropbox recognizes it is the same folder and files so no need to redownload the 100GB again
- Have two computers, next to each other, and they show different file counts. I reported to Google and they said just restart Google Drive. No luck
- And last but not least, I turned if off a few days and not tried to turn it on again. Guess what… It “forgot” I had already downloaded my many GBs of files and is trying to set up a new folder. Which will duplicate my files again and again and simply just make me lose my time.

ditched_001

Bye Google Drive, welcome 200 GB Dropbox

How to view Recent Worklogs in Jira

IMHO Jira is the best bug tracking system all around. It is very user friendly, it is extremely extensible, there are tons of add ons to customize to your needs and GreenHopper brings Agile to Jira. There are many other things worth looking for, but the one great feature where I needed some help was in the worklogs.

Basically when you have a task assigned to a developer, you would like to be able to know what kind of effort/time went into completing it. Well, there is one flaw with this plan and that is that developers need to be very disciplined into entering their hours daily.

Also, they need to make sure that they did not leave any tasks out. So for me the easiest way to make sure that a dev did fill in all of their hours properly was by adding the “Recent Worklogs” add on to their tasks dashboard.

Click here to get the add on

Check it out:

quantum recent worklogs jira add on

Now devs do not have any excuse of forgetting to fill in their work logs. They can see this dashboard and immediately know which day they left out.

Dropbox vs Google Drive – why I am ditching Google Drive

An image is worth a thousand words I’ve heard. Look at the following image. It is VERY SIMPLE.

I have two computers which even more are in the same network, actually sitting one next to each other (which works wonderfully in Dropbox’s LAN sync) and they are showing a different number of files, about 4GB difference.

So why do you want to use a Google Drive for syncing files, when it can’t sync files?!?!?!?!?

1071 files in one computer, 1041 in the other one!

drive_comparison

Google: you need to try harder. Not criticizing you, but don’t release a product that works with users files and that does not work! I reported the problem here https://productforums.google.com/forum/#!msg/drive/TZ4pq4fInaY/QG3VFDTlI88J

TCO de tener un iPhone 5 – lo compro o no?

Actualizacion Ene 7: El plan de iPhone NO permite numero favorito! Y ademas de eso, ni siquiera hay disponibles! Nota mental: mandarse a pedir un iPhone 5 a Estados, sale en $650 y no me preocupo de tener que lidiar con el pensamiento tercer mundista del ICE!

TCO, conocido como total cost of ownership, es lo que a uno le cuesta tener algo durante la vida util de ese activo. En este caso, mas que activo, un juguete.

Basicamente he estado pensando si lo compro o no, por lo que me puse a sacar numeros de si vale la pena o no, tomando en cuenta que pago aproximadamente $70 al mes. Esto es por que estoy midiendome pues era mas cercano a $100. Ojo el analisis:

- Actualmente pago $840 al año por telefono o $1680 por dos midiendome. Entonces, valdra la pena un plan?
- Una cosa mas, ahora NO puedo tener un numero favorito, pero si pudiera entonces eso incluye la mayor parte de mi uso (con plan si se puede)
- Y solo me interesa el de 16GB, los otros siempre me han parecido un desperdicio en mi caso

Veamos la tabla que saco el ICE aca: http://www.grupoice.com/wps/portal/kolbi_postpago_planesyterm_planesiPhone

Esta la puse en Excel y quedo asi, basicamente la pase a dolares y con algunos acumulados. Entonces tengo que ver si quiero pagar $37 / $48 / $68 / $80 al mes de telefono y si quiero pagar inicialmente $540.00 / $318.00 / $474.00 / $186.00 / $354.00 / $282.00 o nada por el iPhone.
iphone5_tabla1

Entonces lo mas facil es ponerlo en una tabla y sumar. Ojo que es importante tomar en cuenta que para los planes de 12 meses vuelvo a poner $70 al mes pues ya estaria fuera de plan otra vez. Yhay que agregarle el favorito que son 7 al mes. No esta sumado pero es la parte mas importante.

Y con eso tenemos un ganador absoluto, iPhone 5 con plan 1 a 24 meses y favorito me ahorra como $400! (dele click y podra ver la tabla en grande)
iphone5_tabla2

Ahora la pregunta del millon, el ice ya vendio el cargamento como de seguro 10 que le mando Apple por equivocacion. Cuando vienen mas?

Colapso la General Cañas?

La noticia del mes es como colapso el puente de la pista al aeropuerto, de como paso una grua de 84 toneladas por encima de un puente de 40 (vendido por una empresa britanica que fue culpada de sobornar politicos en muchos paises) por un conductor con 14 partes.

Alguien ha visto bien el video o de cerca? Mas bien parece que choco pues vean como esta la llanta….

Opiniones? Sera que iba manejando mientras mandaba un mensaje de texto en el celular y se fue mucho para la derecha, paralizando la capital?

FAIL: Buying an MS Surface

As I mentioned before, if you are from a third world country and not the US you generally are no one, especially for anything related to a credit card. After multiple attempts at (legally) buying a Surface, I give up!

How hard is it to buy a Microsoft Surface? Apparently very… and their support is worse!

Microsoft is the same as with other companies. If you don’t have a SSN and your credit card is outside of US, you are nobody :)

But I contacted MS support and they couldn’t even help me get a hold of my order. They just redirected me to the CR office which has absolutely nothing to do with the Surface.

Sid: I understand that you would like to know the status of your Microsoft Surface order you have ordered from Microsoft Store online. Am I right?
Xavier Morera: Yes
Sid: To seek assistance on this matter, I request you to contact the Microsoft Subsidiary for Costa Rica directly. This Customer Service you have reached is for North America. Please give me couple of minutes as I locate the contact information of the assigned Subisidiary Office for your location.
Sid: Please click here to view the full contact information of the Microsoft Subsidiary assigned for Costa Rica
Sid: Please note that our Support Professionals are only trained to troubleshoot issues with North American versions of our products whereas the Support Professionals at the local Microsoft subsidiaries are trained to troubleshoot issues with localized versions of our software and can assist you in your own language.

Oh, and “my language” can be English too…

And then Sid just closed the chat, didn’t even let me finish asking questions.

Sid: I hope your issue gets resolved soon.
Sid: Thank you for using Microsoft Customer Service Chat. Please feel free to come back again. We are available 7 days a week, 24 hours a day.
Chat session has been terminated by the agent.

At the end got a hold of MS Store, and that is the subject of my next post!