Apr
30
2013

Oracle to SQL Server Trigger Migration – Useful Tips

Today got a requirement to convert an Oracle trigger to SQL Server trigger, I have not worked on DDL triggers so did a check on code, it was pretty simple and alongside used few online conversion utilities (limited freeware conversion) which helped in achieving final results.

 


Image Courtesy: Manageengine.com

 

This post is not about writing all aspects of creating triggers; it is just about resources available to help in completing conversion.

 

First, I reviewed following two websites which boast about code conversion,

http://www.sqlines.com and http://www.ispirer.com/

 

They provide following online links to test the conversion of codes from one DB language to another,

http://www.sqlines.com/online and http://convert.ispirer.com/

 

After converting few line of codes on their online conversion links, found that sqllines was not able to convert properly, it even doesn’t understand the substring or cast methods, hence dumped the idea of using it; whereas the output of ispirer is impressive, I find ispirer doing a much better job by doing substrings and cast properly, I used it to achieve final results.

 

Although code was converted but I stuck on one thing which was BEFORE INSERT/UPDATE as Oracle provides BEFORE logic while dealing with triggers whereas SQL Server has only AFTER logic available, there is INSTEAD OF option available but it’s like just modifying the logic behind the code; anyways has supplied that to developer to check on it after supplying converted code using AFTER logic only.

 

Useful Reference:

http://stackoverflow.com/questions/3052169/how-to-create-before-update-trigger-in-sql-server-2005

http://www.sqlines.com/oracle-to-sql-server

http://msdn.microsoft.com/en-us/library/ms189799(v=sql.105).aspx

 

Other Tools available in market:

http://www.spectralcore.com/fullconvert/tutorials/convert-oracle-to-mssql-sql-server.php

http://search.manageengine.com/oratosql/

http://dbconvert.com/convert-oracle-to-mssql-pro.php

Download PDF

About the Author: Nitin G

Indian born, trekker, biker, photographer, lover of monsoons. I've been working full time with SQL Server since year 2005 and blogs to post the content aquired during my research on new topics or fixing issues faced by me as a DBA while working in different kind of projects, hope some of my posts may helps others in SQLDBA community. Everything you read on my blog is my own personal opinion and any code is provided "AS-IS" with no warranties!

Leave a comment

Subscribe to this blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 263 other subscribers

Translate this blog!

EnglishFrenchGermanItalianPortugueseRussianSpanish

Calender

December 2020
M T W T F S S
« Nov    
 123456
78910111213
14151617181920
21222324252627
28293031  

View Post by Categories

%d bloggers like this: