Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

SQLStudies

My name is Kenneth Fisher and I am Senior DBA for a large (multi-national) insurance company. I have been working with databases for over 20 years starting with Clarion and Foxpro. I’ve been working with SQL Server for 12 years but have only really started “studying” the subject for the last 3. I don’t have any real "specialities" but I enjoy trouble shooting and teaching. Thus far I’ve earned by MCITP Database Administrator 2008, MCTS Database Administrator 2005, and MCTS Database Developer 2008. I’m currently studying for my MCITP Database Developer 2008 and should start in on the 2012 exams next year. My blog is at www.sqlstudies.com.

Why am I getting a primary/unique key violation?

This may seem like a question with a simple answer but there is a bit more to it than you might think. In fact I know of 3 possible reasons (and there may be more I don’t know) for seeing a primary key error. Technically they occur for any unique… Read more

0 comments, 74 reads

Posted in SQLStudies on 23 July 2014

Add them to ALL the roles!

I seem to get a lot of permissions questions these days and one of the more frequent ones goes along these lines “I still don’t have the right permissions on database xyq.” So of course the first thing I do is use my handy dandy sp_dbpermissions stored procedure to check… Read more

0 comments, 79 reads

Posted in SQLStudies on 21 July 2014

Yes, Virginia, you can have too much white space.

When I was in college and taking programming classes (back in the days when “a T-Rex ate my 5.25 inch floppy” was a reasonable excuse) we were taught that since the compiler didn’t really see white space we should use it to format our code. And that is absolutely correct.… Read more

10 comments, 5,011 reads

Posted in SQLStudies on 16 July 2014

What does it mean that a value is NULL?

Let’s start by assuming that ANSI_NULLS are ON. If you aren’t sure what ANSI_NULLS are exactly, don’t worry, I’ll be going over that in some detail in a future post. However Microsoft tells us that ANSI_NULLS will always be ON in the near future. So we are not going to… Read more

8 comments, 9,277 reads

Posted in SQLStudies on 14 July 2014

db_ddladmin and the SSMS table designer

If you want to grant a user the ability to create/alter/delete any table, SP, function etc in a database you have a several options. For example:

  • You can grant all of the CREATE permissions either to the database itself or to all of the schemas.
  • You can add the user…

Read more

0 comments, 117 reads

Posted in SQLStudies on 10 July 2014

T-SQL Tuesday #56: Assumptions

I assume that since it’s the second Tuesday of the month that it’s time for T-SQL Tuesday. And you can be certain that Dev Nambi(b/t) has decided to make Assumptions the topic of the 56th T-SQL Tuesday.

I generally like to start with definitions when discussing… Read more

6 comments, 107 reads

Posted in SQLStudies on 8 July 2014

Argenis and the unicorn hoodie

Early yesterday Kirsten Benzel(b/t) announced something very exciting, at least exciting to me. Argenis Fernandez(b/t) has agreed to wear a unicorn hoodie to the 2014 Pass Summit.

Why is this exciting? A number of months ago Kirsten photo-shopped Argenis into this self… Read more

0 comments, 97 reads

Posted in SQLStudies on 2 July 2014

Make BOL your friend

One of the most powerful tools we have as users of SQL Server is Books Online (BOL).  Whether you work mainly as an admin, a developer or in BI, Microsoft has provided a HUGE amount of information for you to use.  But BOL is by no means your only resource… Read more

0 comments, 190 reads

Posted in SQLStudies on 30 June 2014

Dealing with a long string

Every now and again you have to put a really long string (more than 8000 characters). Dynamic SQL is the most frequent example where I see this but I do see it elsewhere as well and it’s very easy to make a simple mistake. This is caused by the fact… Read more

4 comments, 747 reads

Posted in SQLStudies on 25 June 2014

sp_SrvPermissions & sp_DBPermissions V5.0

These are a couple of stored procedures I wrote to help me with security research. Each of the stored procedures returns three data sets.

  1. A list of principals and some basic properties about them.
  2. Role membership
  3. Object/Database/Server level permissions

 
Each of the datasets has a set of do/undo scripts… Read more

2 comments, 117 reads

Posted in SQLStudies on 23 June 2014

Aliasing a SQL Server: When it works, when it doesn’t and when it may be your problem.

Creating an alias for a SQL Server is fairly easy and there are several ways to do it. Configuration Manager is my personal favorite. Open up configuration manager and select the SQL Native Client xx Configuration. Under that you will find Aliases.

From here you can add, update or delete… Read more

10 comments, 1,297 reads

Posted in SQLStudies on 18 June 2014

I don’t want to grant permission to all the tables in the database at once.

A couple of weeks ago I did a post on granting or denying permissions to all the tables within a database. However sometimes you don’t want to grant permissions to the whole database at once. This is still pretty easy but there are no built-in roles to do it.… Read more

1 comments, 235 reads

Posted in SQLStudies on 16 June 2014

What is this default trace you speak of?

I frequently see the default trace mentioned in answers to forum questions, blog posts, articles, even training sessions. My knowledge of it after 15+ years with SQL Server unfortunately minimal. I know that it is a trace that is created by SQL automatically (hence the default) and that it is… Read more

0 comments, 120 reads

Posted in SQLStudies on 12 June 2014

MJ Swart offers free technical editing

A little while back Michael J Swart(B/T) offered to help you become a better writer. This was exciting for me because over the last 2 years (wow I’ve been doing this almost 2 years) I’ve been trying to get better at writing. However getting better… Read more

0 comments, 153 reads

Posted in SQLStudies on 9 June 2014

15 years of experience with Identity columns

  • An identity column is an auto incrementing column
  • An identity column is typically used as a primary key
  • A primary key that’s an identity column is usually a surrogate key
  • A surrogate key is one that is not related to the contents of the row in any way
  • An identity…

Read more

10 comments, 166 reads

Posted in SQLStudies on 4 June 2014

What is the difference between Money and Decimal(19,4)

One of my co-workers and I were discussing the difference between the data type MONEY and the data type DECIMAL(19,4). I was rather curious so I spent some time getting it all down on paper.

Details

First the obvious. MONEY takes up 8 bytes and stores the maximum possible values… Read more

6 comments, 170 reads

Posted in SQLStudies on 2 June 2014

Who has the DAC open?

The other day I started seeing the following error in my SQL log.

Error: 17810, Severity: 20, State: 2.

Could not connect because the maximum number of ’1′ dedicated administrator connections already exists. Before a new connection can be made, the existing dedicated administrator connection must be dropped, either by…

Read more

0 comments, 1,597 reads

Posted in SQLStudies on 28 May 2014

Microsoft’s free virtual labs

If you have spent any time looking around my site, you will notice that I love study materials and in particular I love free ones. I even have a page devoted to study materials most of which are free.

Now Microsoft has dozens of virtual labs available on TechNet Read more

1 comments, 175 reads

Posted in SQLStudies on 26 May 2014

DBA Myths: A table with a primary key is not a heap

Typically when you see a heading like this you know the answer is “No” or “False” but in this case it’s more of a “hu?” You see a primary key and a table being a heap have nothing to do with each other. Well very little anyway.

  • A “Primary…

Read more

4 comments, 1,659 reads

Posted in SQLStudies on 21 May 2014

Escaping from a runaway Logon trigger

Most people know that logon triggers can be dangerous if you aren’t careful. And if you didn’t know, well, logon triggers can be dangerous if you aren’t careful. They can be really useful and are a great tool, but if you mess up you can REALLY mess up.

If you… Read more

0 comments, 898 reads

Posted in SQLStudies on 19 May 2014

Older posts