Are there any benefits to using sql_variant over varchar in SQL Server?
问题 I currently have a database table setup as follows (EAV - business reasons are valid): Id - int (PK) Key - unique, varchar(15) Value - varchar(1000) This allows me to add in mixed values into my databse as key/value pairs. For example: 1 | 'Some Text' | 'Hello World' 2 | 'Some Number' | '123456' etc. In my C# code I use ADO.Net using reader.GetString(2); to retrieve the value as a string, then have my code elsewhere convert it as needed, for example... Int32.ParseInt(myObj.Value); . I'm