|
|
|
Say Hey Kid
      
Group: General Forum Members
Last Login: Friday, May 03, 2013 11:50 AM
Points: 712,
Visits: 410
|
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Today @ 8:09 AM
Points: 1,558,
Visits: 1,396
|
|
|
|
|
|
SSCertifiable
       
Group: Moderators
Last Login: Thursday, May 09, 2013 12:38 PM
Points: 6,462,
Visits: 1,384
|
|
|
|
|
|
Say Hey Kid
      
Group: General Forum Members
Last Login: Friday, May 03, 2013 11:50 AM
Points: 712,
Visits: 410
|
|
Andy,
Are you asking why registry access in general is needed within SQL, or the SQL Server 2005 specific registry keys discussed in the article?
In some ways, the answer is the same. The registry controls how certain programs interact with their environment. Using SQL Server as an example, it specifies certain paths and options, such as the backup path and port options discussed in the article. If you want these options tweaked, you must either use sanctioned front-ends (assuming they are exposed there) or some kind of utility to do so. In my environment, getting those paths and options to be consistent across multiple instances was important enough that I wrote this utility.
For example, the backup path specifies where files will go if they're not fully qualified. This can make it much easier to backup using a DISK= statement.
Does that answer your question?
|
|
|
|
|
SSCertifiable
       
Group: Moderators
Last Login: Thursday, May 09, 2013 12:38 PM
Points: 6,462,
Visits: 1,384
|
|
|
|
|
|
Say Hey Kid
      
Group: General Forum Members
Last Login: Friday, May 03, 2013 11:50 AM
Points: 712,
Visits: 410
|
|
Andy,
I'm not very familiar with SMO or DMO, but you can only work with what portions of the object model are exposed. BackupDirectory is an exposed property, with warnings not to use it. I didn't see any properties for ports. Of course, SMO and DMO have the advantage that they are documented and supported better than registry keys.
For me, I'm comfortable with Perl and the registry so this was my way to solve the issue. I can see that others might prefer a SMO approach.
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Today @ 8:09 AM
Points: 1,558,
Visits: 1,396
|
|
Your list doesn't include the DefaultData and DefaultLog entries in it. These are the only values I read or set on a regular basis: Exec xp_instance_regread N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'BackupDirectory' Exec xp_instance_regread N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'DefaultLog' Exec xp_instance_regread N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'DefaultData'
My blog: SQL Soldier Twitter: @SQLSoldier Microsoft Certified Master: SQL Server 2008 Sr. Product Consultant and Chief SQL Server Evangelist @ Idera My book: Pro SQL Server 2008 Mirroring
|
|
|
|
|
Say Hey Kid
      
Group: General Forum Members
Last Login: Friday, May 03, 2013 11:50 AM
Points: 712,
Visits: 410
|
|
Thanks, Robert, I'll add them in.
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Wednesday, April 03, 2013 8:50 AM
Points: 37,
Visits: 50
|
|
If Microsoft.VisualBasic.Right(hpServerName.ToUpper, 1) = "C" Then
Dim rk As RegistryKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, _
hpServerName).OpenSubKey("Software\Microsoft\Microsoft SQL Server\MSSQL." & strX & "\Cluster")
Dim Instances As String
Instances = rk.GetValue("ClusterName")
To all those who want to do the Perl script in net code behind.
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: 2 days ago @ 4:35 PM
Points: 315,
Visits: 395
|
|
Vince, SQLArg0 will have the first startup option, no matter which one it is. You need check each possible one until the desired startup option is found or the key does not exist. It's annoying. There can several options (e.g., trace flags). SQLArg0,..., SQLArg10,....
Andy, if you have more than a few dozen SQL Servers, it helps to use these tools to standardize the installation and setup via scripts. The GUI leaves too much room for mistakes by large teams. It's also easier to just run the script. There is a SMO Setting class of some sort, but I think it has a warning that it's going away in a future version. I'm stickin' with the xp version until I'm forced to do otherwise. It's nice when something does not have to be fixed with each version - getting too old for much more of that.
|
|
|
|