Missing MIME types in IIS

When working with web applications that uses IIS you might see the following error in the console window for your web browser.

image

Since we are using custom typefaces on our website we need to provide several different fonts to target different devices and platforms. It’s quite common that a client wants to have their own custom font to be used in headings and teasers on their website.

The problem above is because of a missing MIME type mapping in IIS on the web server. The solution is to add the corresponding MIME type extension in the list of supported MIME types. In this case we needed to add the MIME type “application/x-woff” to the extension “.woff”.

image

Problem solved!

Read more:

Advertisements

List constraints for all tables in a database

I’ve been working on a project where I’m been responsible for creating a new relational database model. As the database model grew it became quite hard to get a clear picture over naming of constraints among other things, so I decided to create a script that listed all constraints using SQL Server Management Studio.

Below you can see my solution in how to accomplish this. Just remember to rename the MyCustomSchema to your schema name, or omit it if all your tables belong to the dbo schema.

 

DECLARE @table_name varchar(50)
DECLARE @current_table_name varchar(50)

DECLARE all_tables CURSOR  
FOR SELECT Name from sys.tables

OPEN all_tables

FETCH NEXT FROM all_tables INTO @table_name
WHILE @@FETCH_STATUS = 0
BEGIN
SET @current_table_name = 'MyCustomSchema.' + @table_name
EXEC sp_helpconstraint @current_table_name
FETCH NEXT FROM all_tables INTO @table_name
END

CLOSE all_tables
DEALLOCATE all_tables