From 4d05a2331e120747bcf14fd1d5d87218546744cb Mon Sep 17 00:00:00 2001 From: Rich Date: Mon, 1 Aug 2011 20:12:40 +0000 Subject: [PATCH] Added standard logic at the beginning to check that you are not in a system database --- PROMS/MyGeneration/csla_21/vlnSQL_List.csgen | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/PROMS/MyGeneration/csla_21/vlnSQL_List.csgen b/PROMS/MyGeneration/csla_21/vlnSQL_List.csgen index c82ce434..4a5f278d 100644 --- a/PROMS/MyGeneration/csla_21/vlnSQL_List.csgen +++ b/PROMS/MyGeneration/csla_21/vlnSQL_List.csgen @@ -221,9 +221,30 @@ public class GeneratedTemplate : DotNetScriptTemplate _exportPath = input["outputPath"].ToString(); _dbName = input["chooseDatabase"].ToString(); IDatabase db = MyMeta.Databases[_dbName]; + SavePrefix(); SaveProcsSorted(db); //SaveTables(db); } + private void SavePrefix() + { +%>IF DB_NAME() IN('MASTER','MODEL','MSDN','TEMPDB') +BEGIN + DECLARE @ErrorMsg VARCHAR(255) + SET @ErrorMsg = 'Don''t add these procedures and functions to ' + db_name() + PRINT '==========================================================================' + PRINT '' + PRINT @ErrorMsg + PRINT '' + PRINT 'You probably want to be in the VEPROMS database' + PRINT '' + PRINT '==========================================================================' + RAISERROR (@ErrorMsg, 20, -1) WITH LOG + RETURN +END +PRINT 'Adding procedures and functions to ' + db_name() +GO +<% +} private bool IncludeVolian(string sName) { return (!sName.StartsWith("ve") || (bool)input["chkVolian"]);