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,8 +221,29 @@ public class GeneratedTemplate : DotNetScriptTemplate
|
|||||||
_exportPath = input["outputPath"].ToString();
|
_exportPath = input["outputPath"].ToString();
|
||||||
_dbName = input["chooseDatabase"].ToString();
|
_dbName = input["chooseDatabase"].ToString();
|
||||||
IDatabase db = MyMeta.Databases[_dbName];
|
IDatabase db = MyMeta.Databases[_dbName];
|
||||||
|
SavePrefix();
|
||||||
SaveProcsSorted(db);
|
SaveProcsSorted(db);
|
||||||
//SaveTables(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)
|
private bool IncludeVolian(string sName)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user