-
Notifications
You must be signed in to change notification settings - Fork 1
/
Environmental.cs
36 lines (32 loc) · 1.06 KB
/
Environmental.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using Microsoft.SqlServer.Server;
using System;
namespace MySQLCLRFunctions
{
/*************************************************************************
*
* These don't work, but they can be changed to call actual sound functions.
*
*************************************************************************/
public static class Environmental
{
[SqlFunction(DataAccess = DataAccessKind.None)]
public static int BeepStandard() // Doesn't work from SQL Server :(
{
// 247 is a B
Console.Beep(247, 500);
return 0;
}
[SqlFunction(DataAccess = DataAccessKind.None)]
public static int Beep(int frequencyHz, int durationMs)
{
// 247 is a B
Console.Beep(frequencyHz, durationMs);
return 0;
}
// TODO: UpSince a date, humanize
// TODO: Crashed?
// TODO: Did SQL Server properly restart?
// TODO: What account is SQL Server running as?
// TODO: Mount points and their size
}
}