Showing posts with label sql server. Show all posts
Showing posts with label sql server. Show all posts

31 May 2010

Enable TCP/IP and Named Pipes then connect SQL Server Management Studio

  1. Select SQL Server Services then right-click SQL Server Browser and select Properties.
  2. Switch to the Service tab then set the Start Mode to Automatic. Click OK.
  3. Right-click SQL Server Browser then select Start.
  4. From the left pane, select SQL Server Network Configuration > Protocols for SQLEXPRESS.
  5. Right-click TCP/IP then click Enable. Click OK. Repeat this step to also enable Named Pipes.
  6. From the left pane, select SQL Server Services then right-click SQL Server (SQLEXPRESS) and select Restart.
  7. Select Start > All Programs > Microsoft SQL Server 2008 R2 > SQL Server Management Studio. Note: I may be necessary to run SSMS using the Run as administrator option in the right-click menu. If so, type the administrator password then click Yes.
  8. In the Connect to Server window, type the details for your server connection. Note: The Server name will likely need to be in the format ComputerName\InstanceName. For example, my computer name is Zeus and my SQL Server instance name is SQLEXPRESS. As a result, my Server name is set to Zeus\SQLEXPRESS.
  9. Once you have made the necessary changes, click Connect.

Installing Microsoft SQL Server 2008 R2 Express

  1. Download Microsoft SQL Server 2008 R2 Express and begin the installation.
  2. From the SQL Server Instalation Center, select Installation > New installation or add features to an existing installation.
  3. Accept the license terms then click Next.
  4. After a few moments, the Feature Selection window will display. Select the desired options. During my installation I chose:
    • Database Engine Services
    • SQL Server Replication
    • Management Tools - Basic
    • SQL Client Connectivity SDK
  5. Click Next.
  6. Click Next to use the default instance configuration: SQLExpress.
  7. Click Next to use the default service account and collation settings.
  8. Configure the desired authentication options then click Next.
  9. Set your error reporting preferences then click Next.
  10. Once installation is complete, click Close then exit the SQL Server Instalation Center.

08 January 2008

How do I install the AdventureWorks sample database with SQL Server 2005 Express?

File Download:

  1. Navigate to: http://www.codeplex.com/MSFTDBProdSamples.
  2. From the: Releases tab, click: SQL Server 2005 (hyperlink).
  3. Scroll down and click: AdventureWorksLT.msi.
  4. Save the file to your desktop or other known location.
  5. Once the download is complete, click: Run (or navigate to the location where you saved the file and double-click: AdventureWorksLT.msi) to start the install.
  6. Follow the prompts (using the default selections) to complete the install.

DB Permissions Configuration:

  1. From the keyboard, press: Windows Key + E to launch Windows Explorer.
  2. In Windows Explorer, navigate to: C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data.
  3. Right-click: AdventureWorksLT_Data.mdf then select: Properties.
  4. Click: Security > Edit > Add.
  5. Type your login name into the: Enter the object names... textbox then click: Check Names. Your entry will automatically resolve to: MACHINENAME\Login.
  6. Click: OK.
  7. Select your login name from the: Groups or usernames list.
  8. In the: Permissions for LoginName box, click: Full control then click: OK > OK. You should now be back at the Windows Explorer window.
  9. Right-click: AdventureWorksLT_Log.ldf then repeat this process to change the user permissions for that file as well.

SQL Server Management Studio Configuration:

  1. Launch Microsoft SQL Server Management Studio Express and connect to your local server. Ensure that the default connection settings are used.
  2. From Object Explorer, right-click: Databases then click: Attach. The: Attach Databases dialog will appear.
  3. Click: Add.
  4. Click: AdventureWorksLT_Data.mdf then click: OK.
  5. Click: OK. You should now be at the main window for: Microsoft SQL Server Management Studio Express.
  6. In Object Explorer, expand: Databases > AdventureWorksLT > Tables.
  7. Right-click: dbo.BuildVersion then select: Script Table as > SELECT to > New Query Editor Window.
  8. Press: F5. The query will return the build version, confirming a successful installation.

Possible Problems:

Error: The database 'AdventureWorks' cannot be opened because it is version 631. This server supports version 612 and earlier. A downgrade path is not supported. Could not open new database...

Error: Error 27506. Error executing SQL script sqlscript.sql. Line 17. The database 'AdventureWorksLT' cannot be opened because it is version 631. This server supports version 612 and earlier. A downgrade path is not supported (948)...

These errors are generated when you attempt to install AdventureWorks for SQL Server 2008 on SQL Server 2005. The CodePlex website contains two versions of the database: One for SQL Server 2005 and one for SQL Server 2008. Repeat the: File Download: portion of this tutorial and be sure to click the SQL Server 2005 hyperlink.

Error: Error 1722.There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel...

This error is also generated after attempting to install AdventureWorks for SQL Server 2008 on SQL Server 2005, though this error code may be specific to a Windows XP installation. Either way, repeat the: File Download: portion of this tutorial and be sure to click the SQL Server 2005 hyperlink.

Error: CREATE File encountered operating system error 5(access denied) while attempting to open/create the file.... MS SQL error 5123...

This error (or similar) is related to file permissions for: AdventureWorksLT_Data.mdf and/or AdventureWorksLT_Log.ldf. In either case, repeat the: DB Permissions Configuration: portion of this tutorial.