How to map SQL Server data types to DCIL?

I want to map the data types available in SQL Server 2012 into DCIL.

I'm still learning about DCIL, so as a start, I'd like to make a two column list that shows all of the SQL Server 2012 data types in the left hand column and the equivalent "maps to" DCIL data type in the right hand column.

I already have the list of SQL Server data types but I have not been able to find out much about the data types that are available in DCIL.

Is there a DCIL data type reference somewhere?

&nb
September 13th, 2015 10:29am

Hi Ken,

All I could find about DCIL were a few research papers. The papers mention interoperability between DCIL and C#, so you might try posting on a MSDN CLR forum (or I could move it there for you), or possibly contacting the papers' authors. Here's a mapping of CLR and SQL Server data types https://technet.microsoft.com/en-us/library/ms131092(v=sql.110).aspx Once you have a list a DCIL types, this could be a useful starting point.

Cheers, Bob

Free Windows Admin Tool Kit Click here and download it now
September 13th, 2015 7:06pm

Hi Bob,

I asked this question because I'm trying to understand how an open source software package works with a view to extending it.

For example, below, I have posted a snippet from some code that converts SQL Server datatypes into DCIL data types. The code was written before SQL Server 2008 was announced so the list of datatypes in the "case" sections needs to be extended to handle the new datatypes in later versions of SQL Server.

It is from this and similar code that I have inferred the existence of "DCIL datatypes".

So that's why I'm trying to make my two column list.

I'm at the edge of my knowledge so I would appreciate it if you could move the thread to a "more appropriate" forum.

Thanks

Ken

private DcilDataType.DCILType ConvertSQLServerDataType(string dataType)
        {
            dataType = dataType.ToLowerInvariant();
            switch (dataType)
            {
                case "nvarchar":
                case "varchar":
                case "ntext":
                case "text":
                    return DcilDataType.DCILType.CharacterVarying;
                case "char":
                case "nchar":
                    return DcilDataType.DCILType.Character;


September 13th, 2015 7:42pm

Hi Ken

This  forum is discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O, Regigistry, Globalization, Reflection. Also discuss all the other Microsoft libraries that are built on or extend the .NET Framework. But based on your code, I think you should consider your compatibilityFor example, here are all SQL Server Data Type Mappings. If you choose int32, it stands for 4 bits. so you should match with 4bits.

Best regards,

Kritsin

Free Windows Admin Tool Kit Click here and download it now
September 14th, 2015 4:04am

Hi Kritsin,

Thanks for your response and for the interesting link.

My original post was in the SQL Server forum. It was redirected here by Bob Beauchemin.

If this is not the right forum, then please can you or someone else suggest a forum where I can get some answers about data types in DCIL?

Thanks

Ken

September 14th, 2015 6:35am

Hi Kritsin,

Thanks for your response and for the interesting link.

My original post was in the SQL Server forum. It was redirected here by Bob Beauchemin.

If this is not the right forum, then please can you or someone else suggest a forum where I can get some answers about data types in DCIL?

Thanks

Ken

Free Windows Admin Tool Kit Click here and download it now
September 15th, 2015 3:17am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics