Usuário com melhor resposta
how to query a table in the Extended Stored Procedure

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!
Respostas
-
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- Marcado como Resposta Lisa Zhang - MSFTModerator segunda-feira, 12 de agosto de 2013 14:01
Todas as Respostas
-
这个玩意现在用的少了,参考这个文档。
http://msdn.microsoft.com/zh-cn/library/k78f8tb4(v=vs.71).aspx
通常sql无法处理的问题才会尝试使用这个玩意,操作表等数据内容直接使用sql语句即可。只有某些加密解密算法,读取系统资源等等才可能用到这些xp存储过程。
另外MS现在提供托管代码开发扩展存储过程,这个也是不错的选择。
family as water
-
-
这个玩意现在用的少了,参考这个文档。
http://msdn.microsoft.com/zh-cn/library/k78f8tb4(v=vs.71).aspx
通常sql无法处理的问题才会尝试使用这个玩意,操作表等数据内容直接使用sql语句即可。只有某些加密解密算法,读取系统资源等等才可能用到这些xp存储过程。
另外MS现在提供托管代码开发扩展存储过程,这个也是不错的选择。
family as water
cli可以实现扩展存储过程中访问数据库,主要我时间紧迫,可以直接用原来的扩展存储过程会比较快 -
-
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- Marcado como Resposta Lisa Zhang - MSFTModerator segunda-feira, 12 de agosto de 2013 14:01