Example #1
0
        public static void SetClr(SqlOnOffOptions onOffOption, string connectionString)
        {
            var sql = "EXEC sp_configure 'clr enabled', 1; " + Environment.NewLine +
                      "RECONFIGURE; ";

            ExecuteSql(sql, connectionString);
        }
Example #2
0
        public static void SetTrustworthy(SqlOnOffOptions onOffOption, string connectionString)
        {
            var sql = @"DECLARE @cmd NVARCHAR(MAX); " + Environment.NewLine +
                      "SET @cmd='ALTER DATABASE ' + QUOTENAME(DB_NAME()) + ' SET TRUSTWORTHY ON;'; " +
                      Environment.NewLine +
                      "EXEC(@cmd); ";

            ExecuteSql(sql, connectionString);
        }