My project created in WPF and EntityFramework
I want to create a table in SQL server using Script
Code like this
public override void Up()
{
Execute.Sql(@"CREATE TABLE [dbo].[Exam](
[exam_id] [numeric](18, 0) IDENTITY(1,1) NOT NULL,
[subject_name] [nvarchar](50) NOT NULL,
[emp_id] [numeric](18, 0) NOT NULL,
[department_id] [numeric](18, 0) NOT NULL,
CONSTRAINT [PK_Exam] PRIMARY KEY CLUSTERED
(
[exam_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO");
}
but not create it.
It throws exception
Exception is:
- InnerException {"The table name is not valid. [ Token line number (if known) = 1,Token line offset (if known) = 22,Table name = Exam ]"} System.Exception {System.Data.SqlServerCe.SqlCeException}
What is the mistake in my code?