How can I create a SQL Server system table

I am developing a site that uses Entity Framework code first with migrations. After each major release, I take a copy of the production data and set it up in my development environment. I've found that in order to use a production data copy with migrations, it is necessary to copy the __MigrationHistory table from the old development database image to the production database copy.

This works fine, except for one annoying detail: the _MigrationHistory table comes across as a user table instead of a system table. This is not a serious problem as long as I remember to filter it out of my database diffs. But I would prefer to have the new __MigrationHistory table be a system table, just as it is in a database that was created by EF migrations.

Is there a way I can create or copy a SQL Server table so that it appears to be a system table?
Last updated:2/24/2015 2:27:48 AM

2 Answers

Anonymous User
Anonymous User

Use the following command change your table to system object. So it will then appear in System Objects.

       EXEC sys.sp_MS_marksystemobject _MigrationHistory

Anonymous User
Anonymous User

SELECT name = convert(char(30),, rows, dpages,, type
FROM sysindexes i JOIN sysobjects o ON =
WHERE < 100 and (indid = 0 or indid =1)