locked
Migration Index from Oracle. RRS feed

  • Question

  • Hi,

    I want to convert the below mentioned index from oracle  to SQL Server.

    create index IDX_XXX on ASSETTABLE (TRUNC(TIME_STAMP), ASSET_ID)

    I try to use CAST function instead of Trunc, but it shows Error. Please Provide a solution for me.

    Balakrishnan APD


    Wednesday, May 7, 2014 9:19 AM

Answers

  • Perhaps you should hire a consultant.  Your questions assumes that the people who frequent this forum know Oracle functionality and PL-SQL - which isn't very likely.  You might be more likely to receive useful responses if you can at least identify what TRUNC does and what datatypes are involved.  I will also suggest that you reconsider some basic assumptions that you may have made - specifically that you can translate on a 1-for-1 basis every feature / code snippet in Oracle to a similar feature in SQL Server.  It may be that you need to modify your schema to achieve a similar implementation (or perhaps maybe you don't need a particular feature/implementation at all).  I also suggest that you avoid using reserved words (or ones very similar to reserved words) as identifiers - specifically "TIME_STAMP").  If you haven't yet, you should read the documentation regarding the timestamp datatype just to make sure that you understand what that datatype is - there might be a surprise waiting for you.
    • Marked as answer by tracycai Friday, May 16, 2014 12:36 PM
    Wednesday, May 7, 2014 1:11 PM