Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8086941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:36:24+00:00 2026-06-05T18:36:24+00:00

There are databases on Firebird and SQL Server. I have working stored procedure in

  • 0

There are databases on Firebird and SQL Server. I have working stored procedure in Firebird.

Question is: how to translate it to T-SQL syntax?

begin
  IF ((:PHONE_N is NULL) or (STRLEN(:PHONE_N)<1))  THEN
    BEGIN
      O_PHONE_N = NULL;
      EXIT;
    END

  IF (STRLEN(PHONE_N) > 3) THEN
    BEGIN
      O_PHONE_N = '(' || SUBSTR(:PHONE_N, 1, 3) || ') ';
      PHONE_N = SUBSTR(:PHONE_N, 4, STRLEN(:PHONE_N));
      IF (STRLEN(:PHONE_N)> 3) THEN
        begin
          O_PHONE_N = O_PHONE_N || SUBSTR(:PHONE_N, 1, 3);
          PHONE_N = SUBSTR(:PHONE_N, 4, STRLEN(:PHONE_N));
          IF (STRLEN(:PHONE_NUMBER)> 0) THEN
            O_PHONE_N = O_PHONE_N || '-' ||:PHONE_N;
        END
      ELSE
        O_PHONE_N = :O_PHONE_N || :PHONE_N;
    END
  ELSE
    O_PHONE_N = :PHONE_N;
end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T18:36:25+00:00Added an answer on June 5, 2026 at 6:36 pm

    This link might help a bit: http://www.firebirdsql.org/manual/migration-mssql-syntax.html

    This might help a bit:

    • leading @ marks a T-SQL variable (e.g. @phone_n)
    • STRLEN is called LEN() in T-SQL
    • SUBSTR is SUBSTRING

    Check out the excellent MSDN documentation on T-SQL for more details on T-SQL syntax

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a sql file generated by mysqldump --all-databases . There are many databases
Are there are good in-memory transactional databases that support LINQ and SQL Server persistance?
I use SQL Server. There are 2 databases, old and the new one. Databases
I have a dev MySQL server, on which there are many databases, and most
Is there even a need to periodically compact SQL CE databases? Will auto shrink
Are there any databases, in either the SQL or NoSQL worlds, that support protocol
I have redesigned my Firebird based SQL database. As part of this process I
We have a lot of Firebird databases that we want to convert to MySQL.
We have switched from sqlite to FireBird embedded server, because FB seems to support
We have a relatively large application that is strongly tied into Firebird (stored procedures,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.