Archive for March, 2012

Why does IE6 Double My Margins?

If you compare your site in multiple browsers and find that the margins are twice as big in IE6, you’ve run into a big called the double margin IE6 issue. A known issue, it happens when you style a margin onto a floated element. Luckily it’s an easy fix: add the style attribute “display:inline” to the column with margin.

Then your IE6 version should obey your stylistic vision. Unless of course you have more style problems, but at least this won’t be one of them…

How do I grant a user execute permissions to stored procedures in SQL Server?

One thing that comes up fairly frequently with SQL Server permissions is allowing execute permissions to all user created programmability on a database. This frequently needs to be done when migrating servers, allowing the user connecting to execute stored procedures. One way to do this is to set explicit permissions for all securables for each user. This is effective with a limited amount of stored procedures.

In doing so however, as the number of stored procedures increases, the feasibility of setting explicit permissions decreases. The above also requires that permissions be explicitly granted for newly created stored procedures.

Another way of doing so is to create a role (which we’ll call db_executor) and granting execute permissions to all programmability (or a well-defined subset if you prefer) to said role, then adding desired users to the role. Doing so looks like this:

CREATE ROLE db_executor
GRANT EXECUTE TO db_executor
EXEC SP_ADDROLEMEMBER 'db_executor', 'username'

The above:

  1. Creates the role db_executor
  2. Grants execute permissions to the role
  3. Adds the desired user to the role

Because roles exist within a database, this should be done in the context of the database desiring the programmability required.