Mprocess

Transact-SQL Samples

Samples

Mprocess

This Microsoft® Visual C++® console sample demonstrates how to backup or restore the pubs sample database by using the Virtual Device Interface feature of Microsoft® SQL Server™ 2000. It demonstrates a multiple stream Backup or Restore, in which each stream is handled by a secondary process.

Default Location

C:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Samples\Backup\Mprocess

Running the Sample

Open the mprocess.dsw in Microsoft Visual C++ 6.0 and compile this program. Make sure to do the following before compiling.

  1. From the Tools menu, choose Options, and then click the Directories tab.

  2. From the Show directories for box, choose Include files and Library files, and ensure that these directories (as appropriate) are included:
    • Include files: C:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Include

    • Library files: C:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Lib

To run the sample, open a Command Prompt window, and then change the current directory to where mprocess.exe is located. Run the program by entering "mprocess [b|r] [nStreams]".

The program requires two command line parameters. The first parameter can be one of the following:

  • b:  perform a backup

  • r:  perform a restore

The second parameter gives the number of streams to use. It can be an integer from 1 to 32.

Remarks

This sample is designed for use with Mixed Mode security. Comments explaining how to implement Windows Authentication mode are provided in the code.

See Also

Virtual Backup Device Samples