SQL Server Science
Technical Articles for the DBA / Developer
Home » data-types

Common data-type conversions between SQL Server, Oracle, Sybase ASE, and DB2.

2019-01-16 · by Hannah Vernon · in documentation, tools, troubleshooting

SQL Server includes a little-known, but handy, function that can show you common data-type conversions for a target system; useful for ETL between disparate systems. Run this code:

Transact-SQL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
DECLARE @source_dbms        sysname = N'%'
    , @source_version       sysname = N'%'
    , @source_type          sysname = N'%'
    , @destination_dbms     sysname = N'%'
    , @destination_version  sysname = N'%'
    , @destination_type     sysname = N'%'
    , @defaults_only        bit     = 0;
 
SELECT *
FROM sys.fn_helpdatatypemap (
    @source_dbms
    , @source_version
    , @source_type
    , @destination_dbms
    , @destination_version
    , @destination_type
    , @defaults_only
    );

The above code returns a result-set…

Search

Categories

  • announcements
    • events
  • basics
    • localization
  • configuration
  • DMVs
  • documentation
  • extended-events
  • Internals
  • maintenance
    • patching
  • performance
  • recovery
  • reporting
  • security
    • data security
  • service broker
  • SQL Server Agent
  • statistics
  • sys
  • t-sql
    • xml
  • tools
    • data masking
    • wsus
  • troubleshooting
  • Uncategorized

Pages

  • About SQL Server Science
  • Get Better Help with a Minimal, Complete, and Verifiable Example, or MCVE
  • Privacy Policy

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright © 2025 SQL Server Science