I am trying to do an Entity Framework walkthrough so that I:
- uploaded the SQL script here: http://www.learnentityframework.com
- in SQL Server Management Studio, I right-click Database, Create Database, name it
- right click on the new database, New Query
- clicked "Open file" and opened the script file: Create_ProgrammingEFDB1_SQLServer2008.sql
- clicked "! Execute"
- But the script (756K) has been running for 10 minutes and still says "Executing ..."
My questions:
- Is this the standard way to read in a SQL script in SQL Server?
- Is it supposed to take this long one ? So I would do it in MySQL / PHPMyAdmin, it may take a couple of seconds, so I assume that I am not doing something right.
Here is the beginning of the script, I changed the file paths to point to the desired .mdf and .ldf files:
****/ --PART ONE CREATE THE DATABASE. Note the file paths in the first few commands. --Change them for your own computer.-- USE [master] GO CREATE DATABASE [ProgrammingEFDB1] ON PRIMARY ( NAME = N'ProgrammingEFDB1', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\ProgrammingEFDB1.mdf' , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ) LOG ON ( NAME = N'ProgrammingEFDB1_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\ProgrammingEFDB1_log.LDF' , MAXSIZE = UNLIMITED, FILEGROWTH = 10%) GO ALTER DATABASE [ProgrammingEFDB1] SET COMPATIBILITY_LEVEL = 90 GO IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled')) begin EXEC [ProgrammingEFDB1].[dbo].[sp_fulltext_database] @action = 'disable' end ...
Answer:
I already created a database with the same name, so I tried to create a database that was already there, because of which it was hanging for some reason. I deleted this database, ran the script and successfully completed it in 3 seconds.
sql-server
Edward tanguay
source share