Search code examples
javasql-servert-sqljdbcjtds

What MS SQL Server types map to Types.VARCHAR


I'm working on a statement scanner for our updater (looking for statements that will cause problems with synchronized data) and I need to know which TSQL data types get resolved as Types.VARCHAR and which ones resolve to Types.LONGVARCHAR when you invoke DatabaseMetaData.getColumns()?


Solution

  • check out: Understanding the JDBC Driver Data Types in BOL:

    So basically:

    • LONGVARCHAR: text, ntext, varchar(max), nvarchar(max), xml
    • VARCHAR: varchar, nvarchar