Added standard logic at the beginning to check that you are not in a system database
This commit is contained in:
parent
0da0a6dc56
commit
4d05a2331e
@ -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"]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user