Monthly Archives: April 2012

msSQL UNIQUE Column

So this is something that seems to have fairly poor documentation on. Setting a unique column in msSQL can be done by using the following command:

ALTER TABLE @tableName ADD UNIQUE(@column)

How to force all ASP.NET pages to be SSL

Paste the following code into the system.webserver tags in your web.config file.

        <rewrite>
            <rules>
                <clear />
                <rule name="Redirect to https" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
                </rule>
            </rules>
        </rewrite>