Home > Archive > MS SQL Server > March 2006 > Retrieve DB path from a SP









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Retrieve DB path from a SP
Gaetan Simard

2006-03-14, 11:23 am

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.
KBuser

2006-03-14, 11:23 am

I think you can do it with extended stored procs... this article might
help you...

http://www.devarticles.com/c/a/SQL-...ool-Examples/2/

Steen Persson (DK)

2006-03-14, 1:23 pm

KBuser wrote:
> I think you can do it with extended stored procs... this article might
> help you...
>
> http://www.devarticles.com/c/a/SQL-...ool-Examples/2/
>

You can also try sp_helpdb 'YourDatabaseName'.

Regards
Steen
sqlfan

2006-03-15, 3:23 am

Or, you can try sp_helpfile.


> You can also try sp_helpdb 'YourDatabaseName'.
>
> Regards
> Steen
>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com