Describing Tables in MSSQL

There are 2 particularly good stored procedures in SQL Server for getting information about a particular table.

sp_columns returns detailed information about each of the columns in the table. Thanks to Vincent Ramdhanie StackOverflow answer

sp_columns @tablename

sp_help returns detailed information about the entire table including the columns and constraints. Thanks to Brannon for his StackOverflow answer

sp_help @tablename

Remove a Passphrase from a SSH Key

If you are using GitHub for Windows with non-GitHub repositories, you may have run into the limitation that you cannot sync using an SSH key with a passphrase. One workaround is to push/pull from the shell, but if don’t mind removing the passphrase from the key, use the following command.

ssh-keygen -p -P "my_old_password" -N “” -f my_key_file_name

After you remove the passphrase you should be able to sync from within the GitHub for Windows client.

Pass a Connection String to a Generated DbContext

The default DbContext generated with your Entity Data Model has one constructor that takes no arguments. If you need to build the connection string programatically and pass it to the DbContext, you will have to add your own constructor. However, if you do this in the generated file, {ModelName}.Context.cs, you will lose your changes the next time the {ModelName}.Context.tt script is run.

The solution is to edit the script, {ModelName}.Context.tt. Just add the following code after the code to generate the default constructor (around line 71). Run the script (Ctrl+S), and verify that the new constructor exists in {ModelName}.Context.cs.

    public <#=code.Escape(container)#>(string nameOrConnectionString)
    : base(nameOrConnectionString)
    {
<#
if (!loader.IsLazyLoadingEnabled(container))
{
#>
    this.Configuration.LazyLoadingEnabled = false;
<#
}
#>
    }