Databases Reference
In-Depth Information
result of the stored procedure and just have to execute it, you can use the
CALL statement. To take a backup of the AnalysisServices2005Tutorial data-
base you can send the following MDX statement:
CALL AmoSprocExample.Backup
("AnalysisServices2005Tutorial","AS2K5")
Executing the query results in the backup of the database AnalysisSer-
vices2005Tutorial under the name AS2K5.abf in the Analysis Services
backup directory.
You have added the AMO stored procedure with Unrestricted permission set
access. Now see what happens if you change the permission set to External
Access. You can change the permission set of an assembly by selecting the
properties of the assembly and then changing the appropriate permission set.
Executing the preceding CALL statement to perform a backup now results in
the following error message:
Execution of the managed stored procedure Backup failed
with the following error:
Exception has been thrown by the target of an
invocation.That assembly does not
allow partially trusted callers.
As mentioned earlier, when you specify the external access permission set,
the .NET framework only allows assemblies to have external access. In this
case your assembly AMOExample uses an assembly Mi-
crosoft.AnalysisServices that is not fully trusted by the .NET framework and
does not have the full privilege of performing any operation in the specified
permission set. Therefore, the .NET framework raises the error and does not
execute the assembly. If you are a DBA and you restrict access to assemblies
that you do not fully trust, your Analysis Server will be well secured and reli-
able.
Debugging Stored Procedures
Whenever you write code there are bound to be instances or conditions under
which your stored procedure might not operate in accord with expectations.
You can obviously test your stored procedure external to Analysis Services in
Search WWH ::




Custom Search