Example #1
0
        private static string GetAlterScript(Assembly assembly, DeployParams deployParams)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine(PwrSqlClrCommandBuilder.AlterAssembly_CommandText(assembly, deployParams.PermissionSet, !deployParams.Reference, deployParams.UncheckedData, deployParams.Assembly));

            return(sb.ToString());
        }
Example #2
0
        private static string GetManageScript(ManageParams manageParams)
        {
            StringBuilder sb = new StringBuilder();

            if (manageParams.EnableClr)
            {
                sb.AppendLine(PwrSqlClrCommandBuilder.EnableClr_CommandText());
            }

            if (manageParams.TrustworthyOn)
            {
                sb.AppendLine(PwrSqlClrCommandBuilder.TrustworthyOn_CommandText());
            }

            return(sb.ToString());
        }
Example #3
0
        private static string GetDropScript(Assembly assembly, DeployParams deployParams)
        {
            StringBuilder sb = new StringBuilder();

            if (!deployParams.Reference)
            {
                foreach (Type type in PwrSqlClrObjectsExplorer.GetTypes(assembly))
                {
                    foreach (MethodInfo miTrigger in PwrSqlClrObjectsExplorer.GetTriggers(type))
                    {
                        sb.AppendLine(PwrSqlClrCommandBuilder.DropTrigger_CommandText(miTrigger, deployParams.Schema));
                    }

                    foreach (MethodInfo miProcedure in PwrSqlClrObjectsExplorer.GetProcedures(type))
                    {
                        sb.AppendLine(PwrSqlClrCommandBuilder.DropProcedure_CommandText(miProcedure, deployParams.Schema));
                    }

                    foreach (MethodInfo miFunction in PwrSqlClrObjectsExplorer.GetFunctions(type))
                    {
                        sb.AppendLine(PwrSqlClrCommandBuilder.DropFunction_CommandText(miFunction, deployParams.Schema));
                    }
                }

                foreach (Type userDefinedAggregate in PwrSqlClrObjectsExplorer.GetUserDefinedAggregates(assembly))
                {
                    sb.AppendLine(PwrSqlClrCommandBuilder.DropAggregate_CommandText(userDefinedAggregate, deployParams.Schema));
                }

                foreach (Type userDefinedType in PwrSqlClrObjectsExplorer.GetUserDefinedTypes(assembly))
                {
                    sb.AppendLine(PwrSqlClrCommandBuilder.DropType_CommandText(userDefinedType, deployParams.Schema));
                }
            }

            sb.AppendLine(PwrSqlClrCommandBuilder.DropAssembly_CommandText(assembly, deployParams.Assembly));

            return(sb.ToString());
        }