在 sql server 中擴展存儲過程直接使用的機會不是很多 我把我知道的幾個有用的擴展存儲過程使用方式總結如下 : -- 獲得 MS SQL 的版本號 execute master..sp" name="description" />

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • sql server中擴展存儲過程隨筆(幾個有用的PROCEDURE小總結)

    發表于:2007-05-25來源:作者:點擊數: 標簽:sql過程隨筆存儲擴展
    MI LY: 宋體; mso-ascii-font-family: Times New Roman; mso-hansi-font-family: Times New Roman">在 sql server 中擴展存儲過程直接使用的機會不是很多 我把我知道的幾個有用的擴展存儲過程使用方式總結如下 : -- 獲得 MS SQL 的版本號 execute master..sp

    MILY: 宋體; mso-ascii-font-family: "Times New Roman"; mso-hansi-font-family: "Times New Roman"">在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_ge.netname

    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:aierong@126.com


    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>