"Simon Hayes" <sq*@hayes.ch> wrote in message
news:41********@news.bluewin.ch...
"Zack Sessions" <zc********@visionair.com> wrote in message
news:db**************************@posting.google.c om...I know the default data path on a SQL7 server is defined in the
registry key SQLDataPath. I want to be able to determine the default
data path in a VB.NET application on the local machine and remote
machines. Is using the Registry Class the best way to do that or is
there a SQL command that can tell me? I have read about xp_regread but
I can't find it documented anywhere and I do not know what parameter
list it is expecting. I thought this path may be in an Information
Schema view, but I can't find it.
Thanks for any help.
There's no SQL command to do that - the SQLDMO Registry.SqlDataRoot
property is probably the best option.
xp_regread isn't documented, so it's not really a good idea to rely on it
(in fact, SQLDMO uses another undocumented proc called xp_instance_regread
to get the path).
Simon
I just noticed you're using SQL 7 - xp_instance_regread probably doesn't
exist there, as I guess it's an instance-aware version of xp_regread for SQL
2000. But you may want to consider the question of multiple instances if you
will ever use your application with SQL 2000 in future - that would be
another reason in favour of SQLDMO.
Simon