国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > SQL Server > 正文

sql server中擴展存儲過程隨筆(幾個有用的PROCEDURE小總結)

2024-08-31 00:47:53
字體:
來源:轉載
供稿:網友

在sql server中擴展存儲過程直接使用的機會不是很多

我把我知道的幾個有用的擴展存儲過程使用方式總結如下:

 



 



--獲得ms sql的版本號

execute master..sp_msgetversion

go

character_value                             

-------------------- ----------- -----------

8.00.760             1           3

 



(所影響的行數為 1 行)

 



 



--得到硬盤文件信息

--參數說明:目錄名,目錄深度,是否顯示文件

execute master..xp_dirtree 'c:'

go

execute master..xp_dirtree 'c:',1

go

execute master..xp_dirtree 'c:',1,1

go

 



 



--列出服務器上安裝的所有oledb提供的程序

execute master..xp_enum_oledb_providers

go

 



 



--列出服務器上安裝的所有代碼頁

execute master..xp_enumcodepages

go

 



 



--列出服務器上配置的dsn

execute master..xp_enumdsn

go

 



 



--列出sql server錯誤日志列表,最后更新時間

execute master..xp_enumerrorlogs

go

 



 



 



--列出服務器上所有windows本地組

execute master..xp_enumgroups

go

 



 



--檢測文件存在性

execute master..xp_fileexist 'c:/a.bak'

go

 



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

go

 



 



 



--列出服務器上固定驅動器,以及每個驅動器的可用空間

execute master..xp_fixeddrives

go

 



 



--得到當前sql server服務器的計算機名稱

execute master..xp_getnetname

go

 



 



 



--列出當前錯誤日志的具體內容

exec [master].[dbo].[xp_readerrorlog]

go

 



 



--列出指定目錄的所有下一級子目錄

exec [master].[dbo].[xp_subdirs] 'c:/winnt'

go

 



 



---列出驅動器的名稱

--以字節為單位的空閑空間(low free)

--以驅動器類型:軟驅(1),硬盤(2),cd-rom(8)

exec [master].[dbo].[xp_availablemedia]

go

 



--效果如下:

name             low free    high free   media type

c:/              1270386688  0           2

d:/              1726824448  2           2

e:/              875053056   10          2

f:/              0           0           8

 



(所影響的行數為 4 行)

 



 



還有在[master].[dbo].[sp_addlogin]里面有加密函數pwdencrypt,大家感興趣可以試試

 



希望上面提到的知識對你有所提示

當然歡迎交流和指正

 



author:aierong

blog:http://www.cnblogs.com/aierong

email:[email protected]
  • 本文來源于網頁設計愛好者web開發社區http://www.html.org.cn收集整理,歡迎訪問。
  • 發表評論 共有條評論
    用戶名: 密碼:
    驗證碼: 匿名發表
    主站蜘蛛池模板: 霍林郭勒市| 赣榆县| 开远市| 台东县| 广饶县| 苏尼特右旗| 城口县| 普格县| 灵石县| 方山县| 于田县| 修武县| 墨竹工卡县| 沽源县| 互助| 河曲县| 铜川市| 吉安市| 天峻县| 西丰县| 兰考县| 龙海市| 和田县| 宣武区| 平乐县| 镇赉县| 股票| 台北市| 文水县| 专栏| 廉江市| 高雄市| 司法| 长海县| 乡城县| 清徐县| 松阳县| 延川县| 巩留县| 临西县| 石林|