Tuesday, February 21, 2012

Retrieve DB path from a SP

Is there a method that would work from both SQL 2000 and SQL 2005 to retrieve the path
(Ex: D:\Appl\DB\widget.mdb) of the database the current SP is running from?
I have a need to process a XML file from a SP and I would like the SP to retrieve the
location of the XML file (Ex: D:\Appl\XML\Config.xml) automatically knowing that the XML
and the DB are both under the same root folder (D:\Appl\).
Thanks.I think you can do it with extended stored procs... this article might
help you...
http://www.devarticles.com/c/a/SQL-Server/Extended-Stored-Procedures-Intro-And-10-Cool-Examples/2/|||KBuser wrote:
> I think you can do it with extended stored procs... this article might
> help you...
> http://www.devarticles.com/c/a/SQL-Server/Extended-Stored-Procedures-Intro-And-10-Cool-Examples/2/
>
You can also try sp_helpdb 'YourDatabaseName'.
Regards
Steen|||Or, you can try sp_helpfile.
> >
> You can also try sp_helpdb 'YourDatabaseName'.
> Regards
> Steen
>

No comments:

Post a Comment