I just sheepishly repeated the empiric approach as done 3 years ago here.
I got data types that can be put in a table by SELECT name FROM sys.systypes
:
bigint
binary
bit
char
date
datetime
datetime2
datetimeoffset
decimal
float
geography
geometry
hierarchyid
image
int
money
nchar
ntext
numeric
nvarchar
real
smalldatetime
smallint
smallmoney
sql_variant
sysname
text
time
timestamp
tinyint
uniqueidentifier
varbinary
varchar
xml
(Note that sysname
is in there but table
isn't).
I reverse-engineered a table containing these types with entity framework power tools (beta 3, EF 6.0.0 alpha-3) and got this result:
public partial class AllType{
public int Id { get; set; }
public Nullable<long> bigint { get; set; }
public byte[] binary { get; set; }
public Nullable<bool> bit { get; set; }
public string @char { get; set; }
public Nullable<System.DateTime> date { get; set; }
public Nullable<System.DateTime> datetime { get; set; }
public Nullable<System.DateTime> datetime2 { get; set; }
public Nullable<System.DateTimeOffset> datetimeoffset { get; set; }
public Nullable<decimal> @decimal { get; set; }
public Nullable<double> @float { get; set; }
public System.Data.Entity.Spatial.DbGeography geography { get; set; }
public System.Data.Entity.Spatial.DbGeometry geometry { get; set; }
public byte[] image { get; set; }
public Nullable<int> @int { get; set; }
public Nullable<decimal> money { get; set; }
public string nchar { get; set; }
public string ntext { get; set; }
public Nullable<decimal> numeric { get; set; }
public string nvarchar { get; set; }
public Nullable<float> real { get; set; }
public Nullable<System.DateTime> smalldatetime { get; set; }
public Nullable<short> smallint { get; set; }
public Nullable<decimal> smallmoney { get; set; }
public string sysname { get; set; }
public string text { get; set; }
public Nullable<System.TimeSpan> time { get; set; }
public byte[] timestamp { get; set; }
public Nullable<byte> tinyint { get; set; }
public Nullable<System.Guid> uniqueidentifier { get; set; }
public byte[] varbinary { get; set; }
public string varchar { get; set; }
public string xml { get; set; } }
You see that presently these types are not supported:
hierarchyid
sql_variant
And of course table
, because it's not a column data type in the first place.
Well, this is the dumb approach supplementing tschmit007's smarter answer because, like you, I was just curious.