<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="https://www.sqlines.com/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://www.sqlines.com/feed.php">
        <title>SQLines Tools db2-to-sql-server</title>
        <description></description>
        <link>https://www.sqlines.com/</link>
        <image rdf:resource="https://www.sqlines.com/lib/images/favicon.ico" />
       <dc:date>2026-04-24T14:22:02+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://www.sqlines.com/db2-to-sql-server/cast_stmt?rev=1685639305&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/db2-to-sql-server/char_for_datetime?rev=1503394382&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/db2-to-sql-server/hex?rev=1685737895&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/db2-to-sql-server/hex_constants?rev=1733229059&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/db2-to-sql-server/interval_expressions?rev=1602068359&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/db2-to-sql-server/offset_fetch_first?rev=1733223416&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/db2-to-sql-server/translate?rev=1685737476&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/db2-to-sql-server/xmlelement?rev=1687604196&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/db2-to-sql-server/xmlforest?rev=1662278500&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://www.sqlines.com/lib/images/favicon.ico">
        <title>SQLines Tools</title>
        <link>https://www.sqlines.com/</link>
        <url>https://www.sqlines.com/lib/images/favicon.ico</url>
    </image>
    <item rdf:about="https://www.sqlines.com/db2-to-sql-server/cast_stmt?rev=1685639305&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-06-01T17:08:25+00:00</dc:date>
        <title>CASE Statement in a SQL Procedure - IBM DB2 to SQL Server Migration</title>
        <link>https://www.sqlines.com/db2-to-sql-server/cast_stmt?rev=1685639305&amp;do=diff</link>
        <description>In DB2 stored procedure you can use a standalone CASE statement (do not confuse with CASE expressions inside SELECT statements i.e.)

Microsoft SQL Server does not support CASE statements in Transact-SQL (although it supports CASE expressions in SQL statements like SELECT), so you have to use IF statement instead.</description>
    </item>
    <item rdf:about="https://www.sqlines.com/db2-to-sql-server/char_for_datetime?rev=1503394382&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2017-08-22T09:33:02+00:00</dc:date>
        <title>CHAR Function for Datetime - IBM DB2 to SQL Server Migration</title>
        <link>https://www.sqlines.com/db2-to-sql-server/char_for_datetime?rev=1503394382&amp;do=diff</link>
        <description>In DB2, you can use the CHAR function to convert a datetime value to string using the specified format, for example:

DB2:


  CHAR(CURRENT_DATE, ISO)
  -- 2017-08-22


In SQL Server, you can use the CONVERT function with the specified style:

SQL Server:</description>
    </item>
    <item rdf:about="https://www.sqlines.com/db2-to-sql-server/hex?rev=1685737895&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-06-02T20:31:35+00:00</dc:date>
        <title>HEX Function - IBM DB2 to SQL Server Migration</title>
        <link>https://www.sqlines.com/db2-to-sql-server/hex?rev=1685737895&amp;do=diff</link>
        <description>In DB2 the HEX function converts a string to its hexadecimal representation. In SQL Server you can use CONVERT expressions with appropriate styles.

DB2:


  -- Get hexadecimal representation of 'abc'
  SELECT HEX('abc') FROM sysibm.sysdummy1;
  # 616263</description>
    </item>
    <item rdf:about="https://www.sqlines.com/db2-to-sql-server/hex_constants?rev=1733229059&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-12-03T12:30:59+00:00</dc:date>
        <title>Hex Constants - IBM DB2 to SQL Server Migration</title>
        <link>https://www.sqlines.com/db2-to-sql-server/hex_constants?rev=1733229059&amp;do=diff</link>
        <description>In DB2, you can use the X'FF' syntax to specify a hexadecimal constant (literal). In SQL Server, you have to use the 0xFF syntax.

DB2:


  -- Hex constant
  SELECT X'1234ABCDEF' FROM sysibm.sysdummy1;


SQL Server:


  -- Hex constant
  SELECT 0x1234ABCDEF;</description>
    </item>
    <item rdf:about="https://www.sqlines.com/db2-to-sql-server/interval_expressions?rev=1602068359&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-10-07T10:59:19+00:00</dc:date>
        <title>Datetime Interval Expressions - IBM DB2 to SQL Server Migration</title>
        <link>https://www.sqlines.com/db2-to-sql-server/interval_expressions?rev=1602068359&amp;do=diff</link>
        <description>In DB2, you can use interval expressions to add the specified number of units to a datetime value, for example:

DB2:


  -- Add 3 months to the current date
  CURRENT_DATE + 3 MONTHS


In SQL Server, you can use the DATEADD function to add interval units to a datetime:</description>
    </item>
    <item rdf:about="https://www.sqlines.com/db2-to-sql-server/offset_fetch_first?rev=1733223416&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-12-03T10:56:56+00:00</dc:date>
        <title>OFFSET and FETCH FIRST - Row Limiting - IBM DB2 to SQL Server Migration</title>
        <link>https://www.sqlines.com/db2-to-sql-server/offset_fetch_first?rev=1733223416&amp;do=diff</link>
        <description>In IBM DB2, you can use the OFFSET and FETCH FIRST (or NEXT) clause to limit the rows returned by the query.

In SQL Server 2012 or later, you can also use the OFFSET and FETCH FIRST (or NEXT) clause but the ORDER BY clause must be also specified while this is optional in DB2.</description>
    </item>
    <item rdf:about="https://www.sqlines.com/db2-to-sql-server/translate?rev=1685737476&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-06-02T20:24:36+00:00</dc:date>
        <title>TRANSLATE Function - IBM DB2 to SQL Server Migration</title>
        <link>https://www.sqlines.com/db2-to-sql-server/translate?rev=1685737476&amp;do=diff</link>
        <description>In DB2 you can use the TRANSLATE function to replace the specified characters in string with other characters. SQL Server also provides TRANSLATE function but it has the different order of parameters. 

TRANSLATE is available since SQL Server 2017 only  so for earlier versions you can use nested REPLACE expressions to replace each character individually (see an example below).</description>
    </item>
    <item rdf:about="https://www.sqlines.com/db2-to-sql-server/xmlelement?rev=1687604196&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-06-24T10:56:36+00:00</dc:date>
        <title>XMLELEMENT Function - IBM DB2 to SQL Server Migration</title>
        <link>https://www.sqlines.com/db2-to-sql-server/xmlelement?rev=1687604196&amp;do=diff</link>
        <description>In DB2 XMLELEMENT function allows you to create a XML element (an value with opening and closing tags). In SQL Server you can the special form of SELECT ... FOR XML PATH expression.

Consider a sample table:


  CREATE TABLE cities (name VARCHAR(30), country VARCHAR(30), flag CHAR(1));

  -- Insert sample rows
  INSERT INTO cities VALUES ('Seville', 'Spain', 'S');
  INSERT INTO cities VALUES ('Warsaw', 'Poland', 'P');
  INSERT INTO cities VALUES ('Boston', 'United States', 'U');</description>
    </item>
    <item rdf:about="https://www.sqlines.com/db2-to-sql-server/xmlforest?rev=1662278500&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-09-04T08:01:40+00:00</dc:date>
        <title>XMLFOREST Function - IBM DB2 to SQL Server Migration</title>
        <link>https://www.sqlines.com/db2-to-sql-server/xmlforest?rev=1662278500&amp;do=diff</link>
        <description>In DB2 XMLFOREST function allows you to create multiple XML elements (values with opening and closing tags). In SQL Server you can the special form of SELECT ... FOR XML PATH expression.

DB2:


  SELECT XMLFOREST(country, city)
  FROM
  ( 
    SELECT 'Spain' AS country, 'Malaga' AS city FROM sysibm.sysdummy1
    UNION ALL
    SELECT 'Turkey' AS country, 'Alanya' AS city FROM sysibm.sysdummy1
    UNION ALL
    SELECT 'Greece' AS country, 'Marmaras' AS city FROM sysibm.sysdummy1
  ) t;</description>
    </item>
</rdf:RDF>
