楼主真是够强的,我是连m$里面有说明的都还不怎么清楚。
帮up下,我也想知道。

解决方案 »

  1.   

    微软就喜欢藏一点私,从DOS就这样只有自己去摸索了
      

  2.   

    我告诉你一本书,是科学出版社出的,上面这些sp和xp说的很清楚,你可以看看,不过全套下来要800多元,大的新华书店应该有,书名叫《Microsoft.NET 之 SQL Server 2000全面解析篇》
      

  3.   

    我贴一部份吧,也都是网上看到的。Useful undocumented extended stored proceduresAn extended stored procedure (xp) is a dynamic link library that runs directly in the address space of SQL Server and is programmed using the SQL Server Open Data Services API. You can run extended stored procedures from the Query Analyzer, for example, just as you would normal stored procedures. Extended stored procedures are used to extend the capabilities of SQL Server. You can take advantage of the many extended stored procedures that come with SQL Server, or you can write your own in a programming language such as C or C++.In this article, I want to tell you about some useful undocumented extended stored procedures. These extended stored procedures work with SQL Server 7.0, as well as with SQL Server 2000.
    sp_MSgetversion
    This extended stored procedure can be used to get the current version of Microsoft SQL Server. To get the current SQL Server version, runEXEC master..sp_MSgetversionNote. A more common way to retrieve the current SQL Server version (this way provides more information) is to use following SELECT statement:SELECT @@version
    xp_dirtree
    This extended stored procedure can be used to get a list of all the folders for the folder named in the xp. To get a list of all the folders in the C:\MSSQL7 folder, run:EXEC master..xp_dirtree 'C:\MSSQL7'
    xp_enum_oledb_providers
    This extended stored procedure is used to list of all the available OLE DB providers. It returns Provider Name, Parse Name and Provider Description. To get a list of all OLE DB providers for your SQL Server, run:EXEC master..xp_enum_oledb_providers
    xp_enumcodepages
    This extended stored procedure can be used to list of all code pages, character sets and their description for your SQL Server. To get a list of all code pages and character sets, run:EXEC master..xp_enumcodepages
    xp_enumdsn
    This extended stored procedure returns a list of all System DSNs and their description. To get the list of System DSNs, run:EXEC master..xp_enumdsn
    xp_enumerrorlogs
    This extended stored procedure returns the list of all error logs with their last change date. To get the list of error logs, run:EXEC master..xp_enumerrorlogs
    xp_enumgroups
    This extended stored procedure returns the list of Windows NT groups and their description. To get the list of the Windows NT groups, run:EXEC master..xp_enumgroups
    xp_fileexist
    You can use this extended stored procedure to determine whether a particular file exists on the disk or not.Syntax:EXECUTE xp_fileexist filename [, file_exists INT OUTPUT]For example, to check whether the file boot.ini exists on disk c: or not, run:EXEC master..xp_fileexist 'c:\boot.ini'
    xp_fixeddrives
    This very useful extended stored procedure returns the list of all hard drives and the amount of free space in Mb for each hard drive.To see the list of drives, run:EXEC master..xp_fixeddrives
    xp_getnetname
    This extended stored procedure returns the WINS name of the SQL Server that you're connected to.To view the name, run:EXEC master..xp_getnetname
    xp_readerrorlog
    This extended stored procedure returns the content of the errorlog file. You can find the errorlog file in the C:\MSSQL7\Log directory, by default for SQL Server 7.0.To see the text of the errorlog file, run:EXEC master..xp_readerrorlog
    xp_regdeletekey
    This extended stored procedure will delete an entire key from the registry. You should use it very carefully.Syntax:EXECUTE xp_regdeletekey [@rootkey=]'rootkey',
                            [@key=]'key'  
    For example, to delete the key 'SOFTWARE\Test' from 'HKEY_LOCAL_MACHINE', run:EXEC master..xp_regdeletekey
         @rootkey='HKEY_LOCAL_MACHINE',  
         @key='SOFTWARE\Test' 
    xp_regdeletevalue
    This extended stored procedure will delete a particular value for a key in the registry. You should use it very carefully.Syntax:EXECUTE xp_regdeletevalue [@rootkey=]'rootkey',
                              [@key=]'key',
                              [@value_name=]'value_name' 
    For example, to delete the value 'TestValue' for the key 'SOFTWARE\Test' from 'HKEY_LOCAL_MACHINE', run:EXEC master..xp_regdeletevalue
         @rootkey='HKEY_LOCAL_MACHINE',
         @key='SOFTWARE\Test',
         @value_name='TestValue' 
    xp_regread
    This extended stored procedure is used to read from the registry.Syntax:EXECUTE xp_regread [@rootkey=]'rootkey',
                       [@key=]'key'
                       [, [@value_name=]'value_name']
                       [, [@value=]@value OUTPUT]  
    For example, to read into the variable @test from the value 'TestValue' from the key 'SOFTWARE\Test' from the 'HKEY_LOCAL_MACHINE', run:DECLARE @test varchar(20)
    EXEC master..xp_regread @rootkey='HKEY_LOCAL_MACHINE',
      @key='SOFTWARE\Test',
      @value_name='TestValue',
      @value=@test OUTPUT
    SELECT @test 
    xp_regwrite
    This extended stored procedure is used to write to the registry.Syntax:EXECUTE xp_regwrite [@rootkey=]'rootkey',
                        [@key=]'key',
                        [@value_name=]'value_name',
                        [@type=]'type',
                        [@value=]'value' 
    For example, to write the variable 'Test' to the 'TestValue' value, key 'SOFTWARE\Test', 'HKEY_LOCAL_MACHINE', run:EXEC master..xp_regwrite
         @rootkey='HKEY_LOCAL_MACHINE',
         @key='SOFTWARE\Test',
         @value_name='TestValue',
         @type='REG_SZ',
         @value='Test' 
    xp_subdirs
    This extended stored procedure is used to get the list of folders for the folder named in the xp. In comparison with xp_dirtree, xp_subdirs returns only those directories whose depth = 1.This is the example:EXEC master..xp_subdirs 'C:\MSSQL7'Note.Keep in mind that these undocumented extended stored procedures are not officially supported by Microsoft, and that they may not be found in the next version of SQL Server.
      

  4.   

    谢谢楼上的。
    本人qq:46224435,不过还是icq 才常在线:154259868
    还有哪位愿意提供?如果数量足够,本人愿意做整理翻译并放到这里共享!
      

  5.   

    把无知火的整理了一下:Useful undocumented extended stored procedures一些未声明的扩展存储过程An extended stored procedure (xp) is a dynamic link library that runs directly in the address space of SQL Server and is programmed using the SQL Server Open Data Services API. You can run extended stored procedures from the Query Analyzer, for example, just as you would normal stored procedures. Extended stored procedures are used to extend the capabilities of SQL Server. You can take advantage of the many extended stored procedures that come with SQL Server, or you can write your own in a programming language such as C or C++.扩展存储事实上是一个动态链接库,与一般动态链接库不同的是它们直接运行在sql sever分配的内存地址内,开发是用的也是sqlserver开放数据服务的api,你可以在查询分析器里运行他们,就和一般的存储过程遗言干掉用就可以了。他们是用来加强sqlserver的功能范围的。利用sqlservr附带的存储过程你可以做很多有用的事情,——当然,你要使用你熟悉的编程语言(例如c和c++)来创建你自己的存储过程也是被允许的。In this article, I want to tell you about some useful undocumented extended stored procedures. These extended stored procedures work with SQL Server 7.0, as well as with SQL Server 2000.在这篇文章里,我是要该大家说明一些有用的未声明的存储过程,这些存储过程在sqlserver7.0和sqlserver2000里都有提供sp_MSgetversion
    This extended stored procedure can be used to get the current version of Microsoft SQL Server. To get the current SQL Server version, run这个存储过程返回Microsoft SQL Server的版本号,要获得版本号运行:EXEC master..sp_MSgetversionNote. A more common way to retrieve the current SQL Server version (this way provides more information) is to use following SELECT statement:注意:更常用的方法获得版本信息(这种方法可以获得更多附加信息),是使用下列语句:SELECT @@version
    xp_dirtree
    This extended stored procedure can be used to get a list of all the folders for the folder named in the xp. To get a list of all the folders in the C:\MSSQL7 folder, run:语法(注:原文没有 2003-10-29 add by realgz@csdn):EXEC master..xp_dirtree '目录名'(char),深度(int,可选,默认为1)这个存储过程用来列出对应目录下的文件和文件夹,要获得 C:\MSSQL7的文件列表运行:EXEC master..xp_dirtree 'C:\MSSQL7'
    xp_enum_oledb_providersThis extended stored procedure is used to list of all the available OLE DB providers. It returns Provider Name, Parse Name and Provider Description. To get a list of all OLE DB providers for your SQL Server, run:这个存储过程列出所有可以使用OLE DB驱动,它可以返回驱动名和描述,要列出你的sqlserver可以使用的ole db驱动,运行:EXEC master..xp_enum_oledb_providers
    xp_enumcodepagesThis extended stored procedure can be used to list of all code pages, character sets and their description for your SQL Server. To get a list of all code pages and character sets, run:这个存储过程列出所有的可用编码范围、字符设定和他们的描述,要获得编码范围、字符设定,执行:EXEC master..xp_enumcodepages
    xp_enumdsn
    This extended stored procedure returns a list of all System DSNs and their description. To get the list of System DSNs, run:这个过程返回系统数据源的类表和它们的描述,要获得世界语列表,执行:EXEC master..xp_enumdsn
    xp_enumerrorlogs
    This extended stored procedure returns the list of all error logs with their last change date. To get the list of error logs, run:这个扩展过程返回所有的错误日志和它们的最后更新日期,要获得日志列表,执行:
    EXEC master..xp_enumerrorlogs
    xp_enumgroupsThis extended stored procedure returns the list of Windows NT groups and their description. To get the list of the Windows NT groups, run:这个存储过程返回windowsnt用户组列表和描述,要获得windowsnt用户组列表,执行:EXEC master..xp_enumgroups
    xp_fileexist
    You can use this extended stored procedure to determine whether a particular file exists on the disk or not.
    你可以使用这个扩展过程来确定特定文件(注:文件夹也可以 (原文没有 2003-10-29 add by realgz@csdn))是否存在。Syntax:语法:EXECUTE xp_fileexist filename [, file_exists INT OUTPUT]For example, to check whether the file boot.ini exists on disk c: or not, run:例如,确定在c盘是不是存在boot.ini,运行:EXEC master..xp_fileexist 'c:\boot.ini'
      

  6.   


    xp_fixeddrives
    This very useful extended stored procedure returns the list of all hard drives and the amount of free space in Mb for each hard drive.这个扩展过程很有用,可以列出所有硬盘分区各自的可用空间(单位mb)。To see the list of drives, run:要查看硬盘列表,运行:EXEC master..xp_fixeddrives
    xp_getnetname
    This extended stored procedure returns the WINS name of the SQL Server that you're connected to.这个扩展过程返回当前的sqlserver服务器wins名称。To view the name, run:查看名称,执行:EXEC master..xp_getnetname
    xp_readerrorlog
    This extended stored procedure returns the content of the errorlog file. You can find the errorlog file in the C:\MSSQL7\Log directory, by default for SQL Server 7.0.这个扩展过程返回错误日志内容,错误日志在sqlserver 7.0默认存储于 C:\MSSQL7\Log To see the text of the errorlog file, run:要查看错误日志内容,运行:EXEC master..xp_readerrorlog
    xp_regdeletekeyThis extended stored procedure will delete an entire key from the registry. You should use it very carefully.这个过程可以从注册表删除一个键,使用时要谨慎。Syntax:
    语法:EXECUTE xp_regdeletekey [@rootkey=]'rootkey',
                            [@key=]'key'  
    For example, to delete the key 'SOFTWARE\Test' from 'HKEY_LOCAL_MACHINE', run:例如,从注册表里删除HKEY_LOCAL_MACHINE\OFTWARE\Test,运行:EXEC master..xp_regdeletekey
         @rootkey='HKEY_LOCAL_MACHINE',  
         @key='SOFTWARE\Test' xp_regdeletevalue
    This extended stored procedure will delete a particular value for a key in the registry. You should use it very carefully.这个扩展过程可以删除注册表特定的键里特定的值,使用时要谨慎。Syntax:EXECUTE xp_regdeletevalue [@rootkey=]'rootkey',
                              [@key=]'key',
                              [@value_name=]'value_name' 
    For example, to delete the value 'TestValue' for the key 'HKEY_LOCAL_MACHINE' from 'HKEY_LOCAL_MACHINE', run:例如,要删除键值HKEY_LOCAL_MACHINE\HKEY_LOCAL_MACHINE\TestValue,运行:EXEC master..xp_regdeletevalue
         @rootkey='HKEY_LOCAL_MACHINE',
         @key='SOFTWARE\Test',
         @value_name='TestValue' 
    xp_regread
    This extended stored procedure is used to read from the registry.这个扩展过程可以度曲注册表特定的键里特定的值。Syntax:语法:EXECUTE xp_regread [@rootkey=]'rootkey',
                       [@key=]'key'
                       [, [@value_name=]'value_name']
                       [, [@value=]@value OUTPUT]  
    For example, to read into the variable @test from the value 'TestValue' from the key 'SOFTWARE\Test' from the 'HKEY_LOCAL_MACHINE', run:
    例如,要读取键值HKEY_LOCAL_MACHINE\HKEY_LOCAL_MACHINE\TestValue,运行:DECLARE @test varchar(20)
    EXEC master..xp_regread @rootkey='HKEY_LOCAL_MACHINE',
      @key='SOFTWARE\Test',
      @value_name='TestValue',
      @value=@test OUTPUT
    SELECT @test 
    xp_regwrite
    This extended stored procedure is used to write to the registry.
    这个扩展过程可以在注册表特定的键里写入特定的值。Syntax:语法:EXECUTE xp_regwrite [@rootkey=]'rootkey',
                        [@key=]'key',
                        [@value_name=]'value_name',
                        [@type=]'type',
                        [@value=]'value' 
    For example, to write the variable 'Test' to the 'TestValue' value, key 'SOFTWARE\Test', 'HKEY_LOCAL_MACHINE', run:
    例如,要在键HKEY_LOCAL_MACHINE\HKEY_LOCAL_MACHINE\TestValue写入Test,运行:EXEC master..xp_regwrite
         @rootkey='HKEY_LOCAL_MACHINE',
         @key='SOFTWARE\Test',
         @value_name='TestValue',
         @type='REG_SZ',
         @value='Test' 
    xp_subdirs
    This extended stored procedure is used to get the list of folders for the folder named in the xp. In comparison with xp_dirtree, xp_subdirs returns only those directories whose depth = 1.这个扩展过程列出特定目录下的子文件夹,与xp_dirtree不同,它只列出一级子目录。This is the example:看这个例子:EXEC master..xp_subdirs 'C:\MSSQL7'Note.Keep in mind that these undocumented extended stored procedures are not officially supported by Microsoft, and that they may not be found in the next version of SQL Server.
    最后,请牢记一点,未声明的扩展过程并不被M$正式支持,可能会在以后的版本中消失。