<?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 oracle-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-24T11:35:10+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/add_months?rev=1360506183&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/char?rev=1665529293&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/connect_by_prior?rev=1660337315&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/cursors?rev=1515228180&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/date?rev=1505990674&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/datetime_arithmetic?rev=1726260660&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/decode?rev=1360449808&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/execute_immediate?rev=1507215719&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/from_tz?rev=1690744532&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/instr?rev=1669971855&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/listagg?rev=1685540506&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/months_between?rev=1684879073&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/plsql_tables?rev=1630501702&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/string_concat?rev=1361109534&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/substr?rev=1739032911&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/sysdate?rev=1728813021&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/to_char_datetime?rev=1740645889&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/to_date?rev=1728805162&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/to_timestamp?rev=1673621304&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/trunc_datetime?rev=1765798610&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/update_alias?rev=1727553184&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/xmlelement?rev=1687605009&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.sqlines.com/oracle-to-sql-server/xmlforest?rev=1662277881&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/oracle-to-sql-server/add_months?rev=1360506183&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2013-02-10T14:23:03+00:00</dc:date>
        <title>ADD_MONTHS Function - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/add_months?rev=1360506183&amp;do=diff</link>
        <description>In Oracle, ADD_MONTHS function adds the specified number of months to a datetime value. In SQL Server, you can use DATEADD
function.

Oracle:


   -- Add 3 months to the current date (February 10, 2013):
   SELECT ADD_MONTHS(SYSDATE, 3) FROM dual;
   # 10-MAY-2013</description>
    </item>
    <item rdf:about="https://www.sqlines.com/oracle-to-sql-server/char?rev=1665529293&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-10-11T23:01:33+00:00</dc:date>
        <title>CHAR Data type - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/char?rev=1665529293&amp;do=diff</link>
        <description>Oracle and SQL Server provide the CHAR(n) data type to store fixed-length character data right-padded with blanks to the specified n length:

 Oracle  SQL Server  CHAR  CHAR  CHAR(n)  CHAR(n)  CHAR(n CHAR)  Size in characters  CHAR(n BYTE)  Size in bytes  1 &lt;= n &lt;= 2000, default is 1  1 &lt;= n &lt;= 8000, default is 1  Size n in characters or bytes, but the storage limit is 2000 bytes   Size n in bytes  Default length semantics is defined by NLS_LENGTH_SEMANTICS parameter   Trailing spaces are retain…</description>
    </item>
    <item rdf:about="https://www.sqlines.com/oracle-to-sql-server/connect_by_prior?rev=1660337315&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-08-12T20:48:35+00:00</dc:date>
        <title>CONNECT BY PRIOR - Hierarchical Queries - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/connect_by_prior?rev=1660337315&amp;do=diff</link>
        <description>In Oracle, you can use CONNECT BY PRIOR clause of the SELECT statement to build hierarchical queries. Microsoft SQL Server (MSSQL) allows you to use Recursive Commom Table Expressions (CTE) to get the same functionality.

Rows Generator


One of the simplest use of CONNECT BY is to generate an arbitrary number of rows. For example, the following query generates 5 rows:</description>
    </item>
    <item rdf:about="https://www.sqlines.com/oracle-to-sql-server/cursors?rev=1515228180&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2018-01-06T08:43:00+00:00</dc:date>
        <title>Cursors - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/cursors?rev=1515228180&amp;do=diff</link>
        <description>In Oracle and SQL Server you can declare a cursor, use OPEN, FETCH and CLOSE statements, but besides syntax there are some semantic differences.

Cursor Declaration and Scope


In Oracle cursors are always local i.e visible only within the scope where they are declared. In SQL Server a cursor can be declared as LOCAL or GLOBAL.</description>
    </item>
    <item rdf:about="https://www.sqlines.com/oracle-to-sql-server/date?rev=1505990674&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2017-09-21T10:44:34+00:00</dc:date>
        <title>DATE Data Type - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/date?rev=1505990674&amp;do=diff</link>
        <description>Oracle DATE data type stores date and time data (year, month, day, hour, minute and second).

SQL Server DATE data type  (available since SQL Server 2008) can store only year, month and day, so to preserve the time part you have to use DATETIME or DATETIME2(0) data types when migrating Oracle DATE.</description>
    </item>
    <item rdf:about="https://www.sqlines.com/oracle-to-sql-server/datetime_arithmetic?rev=1726260660&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-09-13T20:51:00+00:00</dc:date>
        <title>Datetime Arithmetic - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/datetime_arithmetic?rev=1726260660&amp;do=diff</link>
        <description>Datetime arithmetic involves addition and subtraction operations on date and time values using + and - operators.

Add and Subtract Days


In Oracle and SQL Server, when you add an integer value to a datetime, you add days:

Oracle:


  ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS';
  
  -- Output the current date and time
  SELECT SYSDATE FROM dual;
  # 2012-06-11 00:39:06
  
  -- Add 3 days to the current day
  SELECT SYSDATE + 3 FROM dual;
  # 2012-06-14 00:39:06</description>
    </item>
    <item rdf:about="https://www.sqlines.com/oracle-to-sql-server/decode?rev=1360449808&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2013-02-09T22:43:28+00:00</dc:date>
        <title>DECODE Function - NULL Issue - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/decode?rev=1360449808&amp;do=diff</link>
        <description>In Oracle, you can use DECODE function to evaluate a list of expressions, and if a value is matched return the corresponding result. 

In SQL Server, you can use CASE expression that is also supported by Oracle. Note that NULL values in DECODE function and CASE expression are handled differently .</description>
    </item>
    <item rdf:about="https://www.sqlines.com/oracle-to-sql-server/execute_immediate?rev=1507215719&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2017-10-05T15:01:59+00:00</dc:date>
        <title>EXECUTE IMMEDIATE - Execute Dynamic SQL - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/execute_immediate?rev=1507215719&amp;do=diff</link>
        <description>In Oracle PL/SQL, you can use EXECUTE IMMEDIATE statement to execute a dynamic SQL statement. 

In Microsoft SQL Server Transact-SQL, you can use EXECUTE statement or EXECUTE sp_executesql stored procedure to execute dynamic SQL statements.

Oracle PL/SQL:</description>
    </item>
    <item rdf:about="https://www.sqlines.com/oracle-to-sql-server/from_tz?rev=1690744532&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-07-30T19:15:32+00:00</dc:date>
        <title>FROM_TZ Function - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/from_tz?rev=1690744532&amp;do=diff</link>
        <description>In Oracle the FROM_TZ function allows you set the specified time zone for a timestamp value that does not have the timezone.  

In SQL Server you can use AT TIME ZONE operator, but note that the supported timezone values can be different (see below).</description>
    </item>
    <item rdf:about="https://www.sqlines.com/oracle-to-sql-server/instr?rev=1669971855&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-12-02T09:04:15+00:00</dc:date>
        <title>INSTR Function - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/instr?rev=1669971855&amp;do=diff</link>
        <description>In Oracle the INSTR function allows you to find the position of substring in a string. It accepts 2, 3 or 4 parameters. 

SQL Server provides the CHARINDEX function to find the position of substring, but it accepts only 2 or 3 parameters, so you have to use an user-defined function when converting Oracle INSTR with 4 parameters.</description>
    </item>
    <item rdf:about="https://www.sqlines.com/oracle-to-sql-server/listagg?rev=1685540506&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-05-31T13:41:46+00:00</dc:date>
        <title>LISTAGG Function - Oracle to SQL Server to Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/listagg?rev=1685540506&amp;do=diff</link>
        <description>In Oracle you can use LISTAGG function to concatenate strings from multiple rows into a single row value.

In SQL Server you can use STRING_AGG function but note that it is available since SQL Server 2017 only. 

Consider a sample table:


  CREATE TABLE cities (name VARCHAR(30));

  -- Insert sample rows
  INSERT INTO cities VALUES ('Seville');
  INSERT INTO cities VALUES ('Warsaw');
  INSERT INTO cities VALUES ('Boston');</description>
    </item>
    <item rdf:about="https://www.sqlines.com/oracle-to-sql-server/months_between?rev=1684879073&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-05-23T21:57:53+00:00</dc:date>
        <title>MONTHS_BETWEEN Function - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/months_between?rev=1684879073&amp;do=diff</link>
        <description>In Oracle, MONTHS_BETWEEN(date1, date2) function returns the number of months between two dates as a decimal number. 

Note that SQL Server DATEDIFF(month, date2, date1) function does not return exactly the same result, and you have to use an user-defined function if you need to fully emulate the Oracle MONTHS_BETWEEN function (see UDF's code below).</description>
    </item>
    <item rdf:about="https://www.sqlines.com/oracle-to-sql-server/plsql_tables?rev=1630501702&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-09-01T13:08:22+00:00</dc:date>
        <title>PL/SQL Tables - TYPE name IS TABLE OF - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/plsql_tables?rev=1630501702&amp;do=diff</link>
        <description>In Oracle you can use PL/SQL Tables to store and process collections of data in a PL/SQL program (procedure, function i.e.). In SQL Server you can use temporary tables to implement such functionality. 

Oracle PL/SQL Table of Records


You can declare, fill in and iterate a PL/SQL table of records as follows:</description>
    </item>
    <item rdf:about="https://www.sqlines.com/oracle-to-sql-server/string_concat?rev=1361109534&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2013-02-17T13:58:54+00:00</dc:date>
        <title>|| String Concatenation Operator - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/string_concat?rev=1361109534&amp;do=diff</link>
        <description>|| operator concatenates one or more strings into a single string in Oracle. 

Quick Example:


   -- Concatenate strings 'New ' and 'York'
   SELECT 'New ' || 'York' FROM dual;
   -- Result: New York


|| Operator Overview


Summary information:</description>
    </item>
    <item rdf:about="https://www.sqlines.com/oracle-to-sql-server/substr?rev=1739032911&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-08T16:41:51+00:00</dc:date>
        <title>SUBSTR Function - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/substr?rev=1739032911&amp;do=diff</link>
        <description>In Oracle, the SUBSTR function returns a substring from a string, starting at the specified position (which can be negative) and for the specified length, or until the end of the string if no length is provided.

In SQL Server, you can use the SUBSTRING function, but it does not allow a negative start position with the same meaning as in Oracle, and the substring length must be specified.</description>
    </item>
    <item rdf:about="https://www.sqlines.com/oracle-to-sql-server/sysdate?rev=1728813021&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-10-13T09:50:21+00:00</dc:date>
        <title>SYSDATE Function - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/sysdate?rev=1728813021&amp;do=diff</link>
        <description>Oracle SYSDATE function returns the current date and time with seconds precision. In SQL Server you can use GETDATE() function but it includes time with milliseconds precision .


Oracle:


  ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS';
  
  -- Get the current date and time
  SELECT SYSDATE FROM dual;
  # 2024-10-13 12:46:28</description>
    </item>
    <item rdf:about="https://www.sqlines.com/oracle-to-sql-server/to_char_datetime?rev=1740645889&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-27T08:44:49+00:00</dc:date>
        <title>TO_CHAR - Convert Datetime to String - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/to_char_datetime?rev=1740645889&amp;do=diff</link>
        <description>In Oracle, TO_CHAR function converts a datetime value (DATE, TIMESTAMP data types i.e.) to a string using the
specified format. 

In SQL Server, you can use CONVERT or CAST functions to convert a datetime value (DATETIME, DATETIME2 data types i.e.) to a string.</description>
    </item>
    <item rdf:about="https://www.sqlines.com/oracle-to-sql-server/to_date?rev=1728805162&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-10-13T07:39:22+00:00</dc:date>
        <title>TO_DATE - Convert String to Datetime - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/to_date?rev=1728805162&amp;do=diff</link>
        <description>In Oracle, TO_DATE function converts a string value to DATE data type value using the specified format. In SQL Server, you can
use CONVERT or TRY_CONVERT function with an appropriate datetime style.

Oracle:


  -- Specify a datetime string and its exact format
  SELECT TO_DATE('2012-06-05', 'YYYY-MM-DD') FROM dual;</description>
    </item>
    <item rdf:about="https://www.sqlines.com/oracle-to-sql-server/to_timestamp?rev=1673621304&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-01-13T14:48:24+00:00</dc:date>
        <title>TO_TIMESTAMP - Convert String to Datetime - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/to_timestamp?rev=1673621304&amp;do=diff</link>
        <description>In Oracle TO_TIMESTAMP function converts a string value to TIMESTAMP data type value using the specified format. In SQL Server you can use CONVERT or TRY_CONVERT function with an appropriate datetime style.

Note that TRY_CONVERT function is available since SQL Server 2012.</description>
    </item>
    <item rdf:about="https://www.sqlines.com/oracle-to-sql-server/trunc_datetime?rev=1765798610&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-12-15T11:36:50+00:00</dc:date>
        <title>TRUNC - Truncate Datetime - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/trunc_datetime?rev=1765798610&amp;do=diff</link>
        <description>In Oracle, the TRUNC(datetime, unit) function allows you to truncate a datetime value to the specified unit (for example, setting the time to zero or setting the date to the first day of the month). By default, it truncates to the day.

In SQL Server, you can use various expressions using CONVERT function to get the same  result.</description>
    </item>
    <item rdf:about="https://www.sqlines.com/oracle-to-sql-server/update_alias?rev=1727553184&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-09-28T19:53:04+00:00</dc:date>
        <title>UPDATE Statement with Alias - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/update_alias?rev=1727553184&amp;do=diff</link>
        <description>Both Oracle and SQL Server support SQL UPDATE statement that allows you to modify the existing table rows, but there are some differences so the conversion may be required. 

UPDATE with Alias


Oracle allows you optionally defining an alias for the updated table:</description>
    </item>
    <item rdf:about="https://www.sqlines.com/oracle-to-sql-server/xmlelement?rev=1687605009&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-06-24T11:10:09+00:00</dc:date>
        <title>XMLELEMENT Function - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/xmlelement?rev=1687605009&amp;do=diff</link>
        <description>In Oracle 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/oracle-to-sql-server/xmlforest?rev=1662277881&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-09-04T07:51:21+00:00</dc:date>
        <title>XMLFOREST Function - Oracle to SQL Server Migration</title>
        <link>https://www.sqlines.com/oracle-to-sql-server/xmlforest?rev=1662277881&amp;do=diff</link>
        <description>In Oracle 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.

Oracle:


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