>--获得MS SQL的版本号 <BR>execute master..sp_msgetversion </P>! e9 Z: |2 o7 l& Z5 R. w. d- ~
>--得到硬盘文件信息 <BR>--参数说明:目录名,目录深度,是否显示文件 <BR>execute master..xp_dirtree 'c:' <BR>execute master..xp_dirtree 'c:',1 <BR>execute master..xp_dirtree 'c:',1,1 </P>, ?& F/ H$ U# K, i7 {( i2 {
><BR>--列出服务器上安装的所有OLEDB提供的程序 <BR>execute master..xp_enum_oledb_providers </P>
>--列出服务器上安装的所有代码页 <BR>execute master..xp_enumcodepages </P>
>--列出服务器上配置的dsn <BR>execute master..xp_enumdsn </P>* g5 _/ u- |9 K% o& G, A
>--列出sql server错误日志列表,最后更新时间 <BR>execute master..xp_enumerrorlogs </P>4 h0 g1 p% I9 g" I
>--列出服务器上所有windows本地组 <BR>execute master..xp_enumgroups </P>) Y3 Q- \0 U2 {
>--检测文件存在性 <BR>execute master..xp_fileexist 'c:\a.bak' </P># t8 k; d! V k1 s- W
>declare @flag int </P>, E1 h6 Z3 H( n; \4 w' F, H
>exec master..xp_fileexist 'c:\abc.bak',@flag out </P>4 L, ~$ @/ F {7 [% U" V
>if @flag=1 <BR>begin <BR>print 'exist' <BR>end <BR>else <BR>begin <BR>print 'no exist' <BR>end </P>
>--列出服务器上固定驱动器,以及每个驱动器的可用空间 <BR>execute master..xp_fixeddrives </P>' J, }( e6 M; t: i [# \. \
><BR>--得到当前sql server服务器的计算机名称 <BR>execute master..xp_getnetname </P>- ~7 u0 T- H0 |4 T
>--列出当前错误日志的具体内容 <BR>EXEC [master].[dbo].[xp_readerrorlog] </P>; T; f3 w. o8 |) S9 N. a
>--列出指定目录的所有下一级子目录 <BR>EXEC [master].[dbo].[xp_subdirs] 'c:\WINNT' </P>
><BR>---列出驱动器的名称 <BR>--以字节为单位的空闲空间(low free) <BR>--以驱动器类型:软驱(1),硬盘(2),cd-rom(8) <BR>EXEC [master].[dbo].[xp_availablemedia] <BR>--效果如下: </P>' L6 \3 J$ K& s& @& U3 s
>name low free high free media type <BR>C:\ 1270386688 0 2 <BR>D:\ 1726824448 2 2 <BR>E:\ 875053056 10 2 <BR>F:\ 0 0 8 </P>- O ]- `8 }% d6 a- v
>还有在[master].[dbo].[sp_addlogin]里面有加密函数pwdencrypt,大家感兴趣可以试试</P>
| 欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) | Powered by Discuz! X2.5 |