Tag Archives: SQL

How to find all the owners of your SQL databases

Sometimes when you go true your list of databases in SQL Studio Manager you notice the owner of the database is somebody who left the company for quite some time. This can happen because the database was create while that person was logged in at that time and he automatically became the owner.

A lot of times accounts are put to disabled in the Active Directory and a scheduled to be deleted an X period later. That’s the moment that problems can arise.

It’s better to make sure your databases are owned by a service account or something like SQLadmin or SA (SQL System Admin). The query below gives you a list of all your database names with the owners so you know which once to change.

 

The Query

select suser_sname(owner_sid),name
from sys.databases

 

Tip to modify your query

If you like to see more columns for what reason so ever. Type , * in the query and you get all the columns including the header names. Now you know what the column is called and you can use that name instead of the * star. Now your query is expanded with the extra column.

 

How to Change?

Right click your database go to properties and under Files in the left column you get the option to modify the database owner in the right part of the screen.

 

 

 

 


0x80040E14 – Mysterious error

 

Yesterday my client was doing some testing on his Acceptation environment and as everything was working proper he came to my desk with a smile and frowning eyebrows.

The error he got was some kind of 0x80040E14 error so I presume it got something to do with authorizations. After hitting strait to  Google I found all kind of WSS 2.0 answers that where completely bogus. So I came back to checking the things which I should have done first anyways, “Like Logs and disc space“.

The reason for this error was that the Log directory from the SQL server run out of disc space on our SAN and because it’s an Acceptation environment it was not being monitored by anyone. I guess it turns out I will adopt this system for the future, As our storage guy said it is not necessary to monitor????