The ascmd command-line utility ( ascmd.exe )

15/04/2009

תגובה אחת

The ascmd command-line utility enables a database administrator to execute an XMLA script, Multidimensional Expressions (MDX) query, or Data Mining Extensions (DMX) statement against an instance of Microsoft SQL Server Analysis Services. This command-line utility contains functionality for Analysis Services that resembles the sqlcmd utility included with SQL Server. For more information, see the topic sqlcmd Utility in SQL Server. The execution results of the script, query, or statement can be stored in a file together with relevant SQL Server Profiler trace information.

What can you do with it?

  • Backing up a database in an UnTrusted domain
  • Automating the build and training of a data-mining model
  • Batch processing multiple partitions
  • Creating a "cache warmer" application and clearing the Analysis Services data cache
  • Creating a new database on a server
  • Creating a validation procedure on an ETL run
  • Discovering when a partition was last processed
  • Querying an Analysis Services cube from the command line

Where can you find it?

You can find it under C:\Program Files\Microsoft SQL Server\100\Samples\Analysis Services\Administrator\ascmd

If does not exist, you should download the Sample code from codeplex .

In order to compile the project, you need to generate a strong name key file.

Follow this steps:

  1. Open a Microsoft Visual Studio 2008 command prompt. Click Start, point to All Programs, point to Microsoft SQL Server 2008, point to Visual Studio Tools and then click Visual Studio Command Prompt.
  2. Use the change directory command (CD) to change the current directory of the command prompt window to the folder where the samples are installed.

Note:

If the default installation location was used, the samples are located in <system_drive>:\Program Files\Microsoft SQL Server\100\Samples.

  1. At the command prompt, run the following command to generate the key file:

sn -k SampleKey.snk

Important:

For more information about the strong-name key pair, see "Security Briefs: Strong Names and Security in the .NET Framework" in the .NET Development Center on MSDN.

To build the sample :

After generating the strong name key file, build the sample using the following instructions.

  1. From the File | Open menu, click Project and open the solution file ascmd.sln.
  2. From the Build menu, click Build ASCMD.

To test the EXE file browse into :

C:\Program Files\Microsoft SQL Server\100\Samples\Analysis Services\Administrator\ascmd\CS\ascmd\bin\Debug

Note:

Microsoft Visual Studio is fully supported on x86 and x64-based computers, but is not supported on Itanium-based computers. As soon as the ascmd command-line utility is compiled, the ascmd command-line utility can be executed on any x86, x64, or Itanium-based computer.

It is a best practice to compile the appropriate version of the ascmd command-line utility because performance might be decreased when you execute 32-bit code on a 64-bit computer.

* it is also working with VISTA,VISTA64BIT and WINDOWS 7 – I have not found a bug yet.

Enjoy ,

Ronen

הוסף תגובה
facebook linkedin twitter email

כתיבת תגובה

האימייל לא יוצג באתר. שדות החובה מסומנים *

תגובה אחת

  1. yo11/03/2010 ב 21:45

    Necesito usar ascmd.exe sin instalar los ejemplos, se puede instalar sólo?
    Gracias.

    הגב