2 Replies Latest reply: Feb 12, 2013 5:44 AM by 990306 RSS

    Ms SQL syntax recognition

      Hi All,

      This is my first post so be gentle!

      I am using SQLDeveloper to connect to both Oracle and MS SQL at different times.

      The stable MS SQL scripts (legacy written in MS Query analyser) I have must be left as just that but I have a new requirement to be able to run them from SQLDeveloper and it seems that the parser will not accept the MS SQL syntax when connected to a MS SQL database. For example "declare @my_variable" is completely not allowed. I could of course change the slq to conform to oracle sql but I do not want to run two versions of the same code.

      Is there any way to tell SQLDeveloper to use MS SQL syntax when connected to a MS SQL database.

      Many thanks,
        • 1. Re: Ms SQL syntax recognition
          Turloch O'Tierney-Oracle
          Hi James,

          SQLDeveloper cannot run T-SQL scripts.

          It can run individual statements:

          MySQL Example:
          If you connect to your MySQL connection you can perform the following
          /*sqldev:query*/show databases;
          /*sqldev:stmt*/use dermot;
          select database();
          /*sqldev:stmt*/use information_schema;
          select database();

          Sybase Example:

          Might be of use if you put your script into a stored procedure/function on the T-SQL side.

          -SQLDeveloper Team
          • 2. Re: Ms SQL syntax recognition
            Hi Turloch,

            Thank you very much for your swift answer; it's a shame it can't run T-SQL but I guess one can't have everything! What a great tool though!!

            Many thanks,