Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I have a configuration table in my database. The value is stored as sql_variant and I have a calculated column to tell me what type that value is (I'm only allowing three types atm: bit, varchar & int).

My question is: How do I save as a specific datatype? The model uses the 'object' type when reading the sql_variant.

I would like to avoid using stored procedures, but failing all else I will set up three different SPs for the three different inserts (or maybe one that does the type conversions)

Any advice / help is welcome.

Thanks
Andy ^_^
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900