Oracle Consulting Oracle Training Oracle Support Development
Oracle Books
SQL Server Books
IT Books
Job Interview Books
Rampant Horse Books
911 Series
Pedagogue Books

Oracle Software
Write for Rampant
Publish with Rampant
Rampant News
Rampant Authors
Rampant Staff
Oracle News
Oracle Forum
Oracle Tips
Articles by our Authors
Press Releases
SQL Server Books

Oracle 11g Books

Oracle tuning

Oracle training

Oracle support

Remote Oracle


Privacy Policy


  SQL Server Tips by Burleson


This XP_PLAYSOUNDFILE XP allows a specific wave file on the file system to be played. Internally it uses the “PlaySound” SDK function. To play a wave file using this function, we use the “SND_FILENAME” flag in the call to the “PlaySound” function. This XP takes 3 parameters. The first parameter is the filename of the wave file to play. The second parameter, which is optional, is a Boolean flag that specifies if the sound should be played synchronously or not. If this flag is true, then the XP will not return until the sound file has completed playing. This internally will correspond to the SND_SYNC flag that gets passed to the “PlaySound” function. If this parameter is not specified then the sound is played asynchronously. This means that playing of the sound file is queued and the XP function returns immediately before the sound has completed playing. The third and last parameter to this XP specifies if the sound file should be played continuously in a loop. Playing of the sound will only stop when the XP_STOPSOUND XP is called (or another sound is played).


This function is quite similar to the XP_PLAYSOUNDFILE XP except that instead of playing a specific file, it plays a sound as specified in the Sound control panel applet. This list of Sound aliases varies from machine to machine depending on the applications installed and version of the operating system. To specify that you want to play a sound alias, you use the “SND_ALIAS” flag instead of “SND_FILENAME” when calling the “PlaySound” function. Assuming you have a “Windows Logon” sound notification setup in the control panel, you could then use the following TSQL code to play this sound:

EXEC master..XP_PLAYSOUNDALIAS 'WindowsLogon', 0, 0

As with XP_PLAYSOUNDFILE, this XP takes an additional 2 optional parameters, which specifies if the sound should be played synchronously and if the sound should be played continuously.

The above book excerpt is from:

Super SQL Server Systems
Turbocharge Database Performance with C++ External Procedures

ISBN: 0-9761573-2-2
Joseph Gama, P. J. Naughter  

Linux Oracle commands syntax poster

ION Oracle tuning software

Oracle data dictionary reference poster

Oracle Forum

BC Oracle consulting support training

BC remote Oracle DBA   



 Copyright © 1996 -2017 by Burleson. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation. SQL Server® is the registered trademark of Microsoft Corporation. 
Many of the designations used by computer vendors to distinguish their products are claimed as Trademarks

Hit Counter