Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Error Message Help PLEASE

Author  Topic 

dbserver2000
Starting Member

47 Posts

Posted - 2009-02-25 : 22:00:33
this is the Error message:

Msg 102, Level 15, State 1, Line 5

This is the T-SQL
USE Master;
GO
CREATE DATABASE Tester;
GO
USE Tester
GO
CREATE TABLE dbo.Roles
(
RoleID int NOT NULL,
RoleName varchar (15) NULL,
CONSTRAINT PK_RoleID PRIMARY KEY (RoleID)
)
GO
CREATE TABLE dbo.Person
(
PersonID int NOT NULL,
LastName varchar (15) NULL,
FirstName varchar (15) NULL,
RoleID int NULL references dbo.Roles
CONSTRAINT PK_PersonID PRIMARY KEY (PersonID)
)
GO
CREATE TABLE dbo.Category
(
CategoryID int NOT NULL,
Category varchar (30) NULL,
CONSTRAINT PK_CategoryID PRIMARY KEY (CategoryID)
)
GO
CREATE TABLE dbo.Tests
(
TestID int NOT NULL,
TestName varchar (30) NULL,
CategoryID int NULL references dbo.category
CONSTRAINT PK_TestID PRIMARY KEY (TestID)
)
GO
CREATE TABLE dbo.question
(
QuestionID int NOT NULL,
QuestionText varchar (200) NULL,
Explanation varchar (300) NULL,
Reference varchar (200) NULL,
TestID int NULL references dbo.Tests
CONSTRAINT PK_QuestionID PRIMARY KEY (QuestionID)
)
GO
CREATE TABLE dbo.Answer
(
AnswerID int NOT NULL,
AnswerText varchar (300) NULL,
CorrectAnswer bit NULL,
QuestionID int NOT NULL references dbo.question
CONSTRAINT PK_AnswerID PRIMARY KEY (AnswerID)
)
GO
CREATE TABLE dbo.TestHistory
(
TestHistoryID int NOT NULL,
PersonID int NULL references dbo.Person
TestID int NULL references dbo.Tests
DateTaken datetime NULL,
Score decimal(4,2) NULL
CONSTRAINT PK_TestHistoryID PRIMARY KEY (TestHistoryID)
)
GO


now what does
Msg 102, Level 15, State 1, Line 5 means?

102 refers to what?

what is level 15?

State 1?

Line 5 is which one?

Thanks for your help

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-02-25 : 23:39:53
CREATE TABLE dbo.TestHistory
(
TestHistoryID int NOT NULL,
PersonID int NULL references dbo.Person,
TestID int NULL references dbo.Tests,
DateTaken datetime NULL,
Score decimal(4,2) NULL
CONSTRAINT PK_TestHistoryID PRIMARY KEY (TestHistoryID)
)

May be this is error check once
Go to Top of Page
   

- Advertisement -