rickgaribay.net

Space shuttles aren't built for rocket scientists, they're built for astronauts. The goal isn't the ship, its the moon.
posts - 258, comments - 163, trackbacks - 28

My Links

News

Where's Rick?



Visual Studio Connections, 3/26

That Conference, 8/13



About Me
I am a developer, architect, writer and speaker, passionate about distributed .NET technologies and Application Lifecycle Management. I am currently the General Manager of the Connected Systems Practice at Neudesic.


    follow me on Twitter



    Archives

    Post Categories

    Published Works

    Writing Vendor Neutral SQL

    I have been reading up on T-SQL (SQL Server) vs P/L-SQL (Oracle) and discovered a handy flag that can be used in SQL Server to ensure FIPS 127-2 (SQL-92/ANSI-92) compliance.
     
    As far as I know, both SQL Server and Oracle only guarantee entry level FIPS 127-2 compliance. Therefore, one of the ways to ensure that your SQL syntax is portable is by keeping your syntax FIPS 127-2 entry-level compliant.
     
    To do so, consider using the SET FIPS_FLAGGER directive when prototyping your queries (BOL reference: http://msdn2.microsoft.com/en-us/library/ms189781.aspx).
     
    For example, setting the flagger to "Entry" reveals that the following syntax is SQL-92 compliant:
     
    SET FIPS_FLAGGER 'ENTRY'

    SELECT Status

    FROM

    TABLE1

    UNION

    SELECT Status

    FROM

    TABLE2

    ---

    RESULTS

    FIPS Warning: Line 1 has the non-ANSI statement 'SET'.

    FIPS Warning: The length of identifier 'CONTAINER_STATUS_VIEW' exceeds 18.

    (7 row(s) affected)

    Note that the FIPS compliance parser also looks at field name size constraints, so you will get warnings similar to above as well. I believe most of these can safely be ignored as there is a fair overlap between vendors, but the main focus should be the syntax.
     
    If anyone has any other tips for writing vendor neutral SQL, I would be very interested.

    Print | posted on Monday, March 05, 2007 12:09 PM | Filed Under [ Misc. ]

    Comments have been closed on this topic.

    Powered by: