none
how to query a table in the Extended Stored Procedure RRS feed

  • Pergunta

  • I‘ve use the sp_addextendedproc to create a  Extended Stored Procedure xp_defunc in the sql server2005,

    sp_addextendedproc 'xp_defunc', 'D:\xp_defunc.dll'

    and the DLL is written in ansi C .

    now I get a requirement that I have to query or change the content of a table in the procedure xp_defunc , my question is

    how can I achieve this, cause I can't get the USER and PASSWORD in sql server2005 by using the API srv_pfield just like what I did in the sql server2000, so I can't connect to the database and operate any data of the database in the procedure  xp_defunc ,

    I've read the MSDN doc  ,but I didn't get anything useful ,

    hope you can give me some adivce ,thanks!

    segunda-feira, 5 de agosto de 2013 10:20

Respostas

Todas as Respostas

  • 这个玩意现在用的少了,参考这个文档。

    http://msdn.microsoft.com/zh-cn/library/k78f8tb4(v=vs.71).aspx

    通常sql无法处理的问题才会尝试使用这个玩意,操作表等数据内容直接使用sql语句即可。只有某些加密解密算法,读取系统资源等等才可能用到这些xp存储过程。

    另外MS现在提供托管代码开发扩展存储过程,这个也是不错的选择。


    family as water

    segunda-feira, 5 de agosto de 2013 14:40
  • 不能直接连接到SQL Server执行扩展存储过程吗?


    Please Mark As Answer if it is helpful.

    quarta-feira, 7 de agosto de 2013 01:33
  • 这个玩意现在用的少了,参考这个文档。

    http://msdn.microsoft.com/zh-cn/library/k78f8tb4(v=vs.71).aspx

    通常sql无法处理的问题才会尝试使用这个玩意,操作表等数据内容直接使用sql语句即可。只有某些加密解密算法,读取系统资源等等才可能用到这些xp存储过程。

    另外MS现在提供托管代码开发扩展存储过程,这个也是不错的选择。


    family as water


    cli可以实现扩展存储过程中访问数据库,主要我时间紧迫,可以直接用原来的扩展存储过程会比较快
    quarta-feira, 7 de agosto de 2013 09:24
  • 不能直接连接到SQL Server执行扩展存储过程吗?


    Please Mark As Answer if it is helpful.


    是扩展存储过程里面有处理逻辑,现在需要在扩展存储过程处理逻辑里加入一些数据库操作,听起来是蛮不合理,但是现在确实有这样的需求,而且时间紧迫,因此来不及换cli
    quarta-feira, 7 de agosto de 2013 09:26
  • according to MSDN, you will need distributed queries to play with database.

    http://technet.microsoft.com/en-us/library/ms175200(v=sql.90).aspx

    You should also consider using distributed queries to access the database. For more information, see Distributed Queries.


    If you think my suggestion is useful, please rate it as helpful.
    If it has helped you to resolve the problem, please Mark it as Answer.
    http://twitter.com/7Kn1ghts

    quarta-feira, 7 de agosto de 2013 15:40