AddTable

0 views
Skip to first unread message

Stuart

unread,
Sep 30, 2008, 11:13:17 AM9/30/08
to migratordotnet-devel
Hey Guys,

Awesome work with this project, exactly what I was after.

I am using MS SQL Express, all works pretty well except I have to
manually add \" to the table name:

public override void Up()
{
Database.AddTable("\"User\"",
new Column("ID", DbType.Int32,
ColumnProperty.PrimaryKeyWithIdentity),

If I just use "User" I get an error, am I doing something wrong?

Cheers,
Stuart

N.D.

unread,
Sep 30, 2008, 11:14:58 AM9/30/08
to migratordo...@googlegroups.com

maybe User is a keyword, try [User]

Geoffrey Lane

unread,
Sep 30, 2008, 11:16:12 AM9/30/08
to migratordo...@googlegroups.com
User is a reserved word in SQL Server. We don't have a table of all
the reserved words for every database or anything like that to quote
them for you.
As you pointed out, you found the workaround for that.

So, no, you're not doing anything wrong. You could also name it Users
(plural) and not need to quote it.

--
Geoff Lane <geof...@gmail.com>

Reply all
Reply to author
Forward
0 new messages