Windows Managed Service Accounts

I had a much longer post here but when I published it, the content disappeared. So until I decide to go through the steps again and redocument them, the short story is: Managed Service Accounts are great. I like them better than the standard way service accounts were handled in the past. When creating an account, be sure the account is not longer than 15 characters. If longer than 15 characters, you will not be able to install them on the computer you want to use them on.

These can be used only on a Windows 2008 R2 and Windows 7. They can only be created on a domain controller that has been upgraded to the 2008 R2 Schema but the domain itself can be either 2008 R2, 2008, 2003, or mixed-mode. Only the 2008 R2 domain level can provide automatically managed passwords and SPN.

Main commands to be able to use Managed Service Accounts are:

  • New-ADServiceAccount -name <accountname> -description “accountdescription”
  • Add-ADComputerServiceAccount -computer <computername> -serviceaccount <accountname>
  • Install-ADServiceAccount -identity <accountname>

These commands have to be run from the Active Directory Module for Windows Powershell as an administrator or some of the commands will fail. The first command creates the account in AD. The second command assigns the account to the computer to use the account. The last command should run from the computer you plan to use the account.

I Like SQL Server Data Tools

SQL Server Data Tools makes life much easier for me. I now can easily version control all of my SQL objects. The only thing right now I don’t like is the fact that it cannot perform data comparisons or migrations yet.

It’s easier to work with database projects with SQL Server Data Tools compared to the database projects in Visual Studio 2010.

SQL Developer Data Modeler 3.1 Connection to SQL Server 2008 using Microsoft JDBC Driver

First, download the Microsoft JDBC driver.

Once extracted, I copied the sqljdbc4.jar file into the lib folder under the jdbc folder of the SQL Developer Data Modeler but you just need to know where the jar file is located.
Go to Tools > Preferences > Data Modeler > Third Party JDBC Drivers and click the plus to add the location of the jar file. Then click the OK button.
If on a Windows machine and you want to use integrated security, edit your system path to include the location of the sqljdbc_auth.dll file or copy the sqljdbc_auth.dll to an existing location in your system path, like Windows\System32.
Then click File > Import > Data Dictionary.
Click the Add button.
Click the JDBC tab
Choose Other ThirdParty Driver
For JDBC URL, type jdbc:sqlserver://[serverName[\instanceName][:portNumber]][;property=value[;property=value] – or look here for details about how to form the URL.
For Driver Class, type com.microsoft.sqlserver.jdbc.SQLServerDriver
For Database Type, choose SQL Server.

Assuming your URL is correct, click the test button and you should get success.

SQL Server CTE Performance

I had to review a stored procedure to figure out why it was causing the web application to timeout when being passed certain parameters. The web application was using this one stored procedure to not only show a search results page (with 9 columns) but also to show the detail for a particular row (showing all 39 columns in a separate window). The stored procedure was using a CTE to handle/enable paging. Reviewing the code showed at the end of the CTE, the code had the following:

1
 SELECT * FROM CTE

This version of the code would take up to 4 minutes to display a result based upon the parameters used.

The fix was to change

1
 SELECT *

to

1
 SELECT ColumnName

and this improved the performance dramatically. Where the original code took up to 4 minutes to display a result, this change had the results display instantly (well, under a second).

The lesson, only use

1
 SELECT * FROM OBJECT

when absolutely necessary (and when is that?).

Issues Installing Windows 8 Preview in VirtualBox – With Fix

I decided to install the Windows 8 Preview as a new VirtualBox virtual machine, since I use VirtualBox as my Virtual Machine software.

I ran into some snags at first though and couldn’t get the setup started. I usually setup all of my Windows virtual machines with the following configuration:







This configuration caused the setup to fail or make my CPU usage super high. In order to get it working I had to make one change:

So in words, I had to change the storage controller from SATA/AHCI to IDE/PIIX4. This allowed me to start the setup successfully.

SQL Server 2008 R2 Service Pack 1 Released

Today SQL Server 2008 R2 Service Pack 1 is released today.
Get it here.

  • Dynamic Management Views for increased supportability.
  • ForceSeek for improved querying performance.
  • Data-tier Application Component Framework (DAC Fx) for improved database upgrades. 
  • Disk space control in PowerPivot for SharePoint.
  • Support for 512e Drives.
  • Fixed various issues.