title: use SQL script to create SQL server DB
body: <p>I have a very basic question about SQL server and Visual Studio 2010. I'm currently reading the book "C# 3.0 Unleashed with the .NET framework 3.5". I'm at the chapter where LINQ to SQL is explained. The writer asks to create a new database and use his script (given in the book) to create the tables and fill these with some data.</p>
  
  <p>However, as I've never worked with SQL server before, this part is a bit confusing for me. The writer doesn't explain how to create the database. First I thought I could just right-click on <code>Data Connections -&gt; Create New SQL Server Database</code>. However, when I tried that, I only got an error explaining no connection could be made.</p>
  
  <p>When that didn't work, I added a new <code>Service-based Database</code> via <code>Add -&gt; New Item</code>. This works (although I do not understand the difference between this and the previous thing I've tried. If someone could explain this for me, It'd be very appreciated), but now I'm supposed to use the script to create the tables and enter some data. I can right-click on the database and select <code>New Query</code>, but that window doesn't seem to accept such scripts.</p>
  
  <p>First part of the script:</p>
  
  <pre><code>/****** Object: Table [dbo].[HospitalStaff]Script Date: 12/29/2007 21:42:42 ******/
  SET ANSI_NULLS ON
  GO
  SET QUOTED_IDENTIFIER ON
  GO
  IF NOT EXISTS (
  SELECT * FROM sys.objects
  WHERE object_id = OBJECT_ID(N’[HospitalStaff]’)
  AND type in (N’U’))
  BEGIN
  CREATE TABLE [HospitalStaff](
  [HospitalStaffID] [int] IDENTITY(1,1) NOT NULL,
  [Name] [varchar](50)
  COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
  [Position] [varchar](50)
  COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
  CONSTRAINT [PK_HospitalStaff] PRIMARY KEY CLUSTERED
  (
  [HospitalStaffID] ASC
  )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF,
  IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON,
  ALLOW_PAGE_LOCKS = ON)
  )
  END
  </code></pre>
  
  <p>I know it's a very basic question, but where can I execute this script? I've visited several websites with SQL server tutorials, but it's all pretty confusing.</p>