Access the Database Server
1. Locate the SQL Server Management Studio icon by clicking "Start", "All Programs", "Microsoft SQL Server 2005" (or 2008).
2. Select "Database Engine" from the Server Type drop-down menu.
3. Enter the server name or select it from the "Server name" drop-down menu (if it already exists).
4. Select the authentication option from the "Authentication" drop-down menu (either "Windows Authentication" or "SQL Server Authentication"). You are required to enter your user name and password if using "SQL Server Authentication".
5. Click "Connect". Set a Primary Key Using T-SQL
6. Click "New Query" from the "File" menu or "Standard" toolbar.
7. Type "ALTER TABLE dbo.Books ADD CONSTRAINT" and press "Enter" on your keyboard.
8. Type "PK_Books PRIMARY KEY CLUSTERED (ISBN)" and press "Enter" on your keyboard.
9. Type "WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]".
10. Click the "Execute" button on the SQL toolbar or press "F5" on your keyboard. Set a Primary Key Using the Table Designer
11. Expand the database containing the "[dbo].[Books]" table in the "Object Browser".
12. Right-click on the table and left-click "Design" in the menu that appears.
13. Right-click on the "ISBN" field and left-click "Set Primary Key" in the menu that appears.
14. Click the "Save" (disk) icon on the toolbar or use the "Ctrl + S" keyboard combination to save the changes.