Split versions

Split script depending on version of MSSQL.

NOTE: Eventually will be merged again.