using SQL Server 2005 with SP4 and I am designing a database table.
Here is the table DDL
CREATE TABLE CPSync4D.ProjectProfilerOption
(
ProjectProfilerOptionID INT IDENTITY(1,1) CONSTRAINT PK_ProjectProfilerOption_ProjectProfilerOptionID PRIMARY KEY
,ProjectID INT CONSTRAINT FK_ProjectProfilerOption_Project_ProjectID FOREIGN KEY(ProjectID) REFERENCES CPSync4D.Project(ProjectID) ON DELETE CASCADE
,ProfilerOptionID TINYINT CONSTRAINT FK_ProjectProfilerOption_ProfilerOption_ProfilerOptionID FOREIGN KEY(ProfilerOptionID) REFERENCES CPSync4D.ProfilerOption (ProfilerOptionID)
,ProfilerOptionValue sql_variant NOT NULL
)
Go
profileroptionvalue column can hold either a string upto 30 characters, integer or decimal values e.g. values are "ProfilerValueType", or 12.52 or 20 etc. (no more than than two decimals and integer values are less than 100)
Should I use sql_variant or varchar(30)...? I never used sql_variant before and not sure any implication of not using in terms of database design.
Any pitfalls of using sql_variant...with .net code