-- Obtain the version number of MS SQL
Execute master .. sp_msgetversion
-- Obtain the hard disk file information
-- Parameter description: directory name, directory depth, and whether to display files
Execute master .. xp_dirtree 'C :'
Execute master .. xp_dirtree 'C: ', 1
Execute master .. xp_dirtree 'C: ', 1, 1
-- List all programs provided by OLEDB installed on the server
Execute master .. xp_enum_oledb_providers
-- List all code pages installed on the server
Execute master .. xp_enumcodepages
-- List the dsn configured on the server
Execute master .. xp_enumdsn
-- List the SQL server error logs and the last update time
Execute master .. xp_enumerrorlogs
-- List all windows Local Groups on the server
Execute master .. xp_enumgroups
-- Check file existence
Execute master .. xp_fileexist 'C: \ a. Bak'
Declare @ flag int
Exec master.. xp_fileexist 'C: \ abc. Bak', @ flag out
If @ flag = 1
Begin
Print 'exist'
End
Else
Begin
Print 'no exist'
End
-- List the fixed drives on the server and the available space for each drive
Execute master .. xp_fixeddrives
-- Obtain the computer name of the current SQL server.
Execute master .. xp_getnetname
-- List the specific content of the current Error Log
EXEC [master]. [dbo]. [xp_readerrorlog]
-- List all sub-directories under a specified directory
EXEC [master]. [dbo]. [xp_subdirs] 'C: \ WINNT'
--- List drive names
-- Low free space in bytes)
-- Drive type: Hard Drive (1), Hard Drive (2), cd-rom (8)
EXEC [master]. [dbo]. [xp_availablemedia]
-- The effect is as follows:
Name low free high free media type
C: \ 1270386688 0 2
D: \ 1726824448 2 2
E: \ 875053056 10 2
F: \ 0 0 8
The [master]. [dbo]. [sp_addlogin] contains the encryption function pwdencrypt. If you are interested, try again.