sp_GetRowcount: How to count the number of rows in any SQL Server table fast

Have you ever had to find the number of rows in a user table, and then wrote a little “SELECT COUNT(*) FROM tblWhatever” and hit execute…and waited…and waited…and waited some more? And then started wondering what was going on?

If so, this post is for you.

Let me explain the problem, and then give you a reusable solution. Consider this a turning point in your career.

Continue reading

#TSQL2sday – Preconceived Notions About Who Is Smart

For this month’s #TSQL2day, Andy Yun asked folks to share about “something you’ve learned, that subsequently changed your opinion/viewpoint/etc. on something.”

Now, there are technical subjects I could share where I’ve changed my opinion, but in thinking about possible answers I realized all of them start with one thing that has changed: who I thought was “smart”.

I put the word smart in quotes, because it’s a totally subjective and ever-changing opinion. Let me show you what I mean.

Continue reading

What permissions are required for temporary tables?

Managing permissions is a constant issue for Database Administrators, but rarely do DBAs consider permissions for tempdb. Everybody’s looking for something, but how often do you get requests for “access to read and write in the tempdb database”? Like…never?

OK, but what if you were asked the subject of this post in a job interview? Even if you’ve worked with SQL Server for ages, would you know how to answer this? Moreover, would you know why the answer should give you some concern?

Hold your head up, because I’ll start answering these questions now.

Continue reading