Unix Technical Forum

Recommended method to obtain SQLDataPath

This is a discussion on Recommended method to obtain SQLDataPath within the SQL Server forums, part of the Microsoft SQL Server category; --> I know the default data path on a SQL7 server is defined in the registry key SQLDataPath. I want ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 05:24 AM
Zack Sessions
 
Posts: n/a
Default Recommended method to obtain SQLDataPath

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 05:24 AM
Simon Hayes
 
Posts: n/a
Default Re: Recommended method to obtain SQLDataPath


"Zack Sessions" <zcsessions@visionair.com> wrote in message
news:db13d9fb.0409290532.245851a8@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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-29-2008, 05:24 AM
Simon Hayes
 
Posts: n/a
Default Re: Recommended method to obtain SQLDataPath


"Simon Hayes" <sql@hayes.ch> wrote in message
news:415acd99_3@news.bluewin.ch...
>
> "Zack Sessions" <zcsessions@visionair.com> wrote in message
> news:db13d9fb.0409290532.245851a8@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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:28 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com