This article describes the installation and configuration of SQL Server 2008 required for deploying SharePoint Server 2010 and is part of a series describing the complete installation of SharePoint Server 2010 on Windows Server 2008 R2 and SQL Server 2008 R2. During the installation of SQL Server we install only the minimum required features.
Please note that different features of SharePoint may require additional features to be installed. I prefer to install the least required features since the size of the image matters for me and the process will be much faster if you copy or move the virtual image. The installation of SQL Server will be done on the same server where SharePoint 2010 will be installed. This way I have everything (except the Active Directory) in one image so I can easily make a backup or restore by just making a copy of my virtual image.
Regarding the needed accounts we have to distinguish between a SharePoint related account and a SQL Server related account. SQL can be installed with a domain account which is used to run the services. This account is used to install SQL Server and in this guide not directly related to SharePoint. The SharePoint related account is needed to install SharePoint and needs certain permissions and roles in SQL Server which are described at the end of this post.
In this scenario the SharePoint account is also used as the SQL Server administrator so I can use the same account to administrate SharePoint and SQL Server.
Note: If you're done please read the comment at the end of this post by Wes Preston. He mentions a book describing how to install SQL Server 2008 R2 on the same machine where you want to install SharePoint 2010. Shortiiik explains in the comments why. Don't hesitate to post your comments too or to ask a question if you have one. Also check the overview where you can find the complete series and of course the farm topology and the deployment scenario.
Please have also a look at
So let's get it on...
SQL Server 2008 installation
The installation of SQL Server 2008 compared to SQL Server 2008 R2 is almost the same and described below.
If you get a compatibility warning while trying to install SQL Server 2008 on Windows Server 2008 R2 you can proceed with install.
Before running SQL Server you need to apply Service Pack 1.

SQL Server 2008 R2 installation
If you haven’t done yet install .NET Framework 3.5 SP1.
On the left side click “Installation” and on the right side click "New installation or add features to an existing installation".

Install the setup support files.

Select “SQL Server Feature Installation”.

Select the “Database Engine Services” feature and the “Management Tools - Basic” feature. Check additional features if needed.

Check additional features if needed.
Keep the default instance and default folders.

Use the same account for the services and select the sqlSvcAcc you created in Active Directory.
Keep the collation settings you can see in the screenshot.

Add the SharePoint 2010 setup administrator user as a “SQL Server Administrator”.

Click next at the “Installation Configuration” Rules screen.

Start the installation of SQL Server 2008 R2.

SQL Server 2008 R2 configuration
There are 2 configuration steps you need to do: assign permission to the SharePoint 2010 setup administrator and configure networking.
Assign permission
The SharePoint 2010 setup administrator needs to have the securityadmin and dbcreator role. The sysadmin role is assigned if you decide during SQL Server 2008 installation that your SharePoint 2010 setup administrator should be the SQL admin.
I decided to do so in my Hyper-V development environment.

Configure networking
At the end you need to configure networking if you are planning to deploy a farm with multiple SharePoint Server 2010 servers.
According to TechNet [1] you need to “ensure that SQL Server 2005 or SQL Server 2008 is updated to the required level and configured as follows”:
- SQL Server 2005: Local and remote connections are enabled and are configured to use the TCP/IP protocol.
- SQL Server 2008: The TCP/IP protocol is enabled for the network configuration.
RTM: TechNet still says (May 6, 2010) you need TCP/IP but you don’t need Named Pipes. From my experience you need Named Pipes.

Difference to SharePoint 2007
In SharePoint 2007 you needed to configure named pipes which isn’t necessary in SharePoint 2010.
Resources
Here are the resources used in this article:
Next steps
The Updated & Complete SharePoint 2010 Installation Material
with 46 PowerShell Scripts
"There is no other SharePoint resource I rely on more." ~ Daryl Sharpe
Show me the PDF & PowerShell
Learn more about SharePoint 2010 Installation