Friday, November 28, 2014

convert non-ANSI joins to ANSI Using the Query Designe in Sql server management studio

today i was a working on a task , in which i have to verify the query which we converted as we moved from Sql server 2008 to Sql server 2012.

Sql server 2012 do not support NON ANSI Joins and since my project code was having so many queries . And so many quries having old NON ANSI JOIN syntax [ having =* or *= for left / right join]

Problem that we were facing after conversion that so many queries were not providing results or incorrect results.

Hence i was started searching some solution how we can verify that our converted queries works in the same way it was working in Sql server 2008
then i got it very nice post convert Non-ANSI joins to ANSI And Boila...i was able to verify and convert the my old query to new syntax query .

Basically crux of the story is
If you have legacy code that you are upgrading, the Query Designer can convert old style joins to ANSI joins.

Steps to verify and converts are:
1. connect with SSMS (Sql server management studio)
2. paste your old NON ANSI query in query sheet
3. select the query and hit Ctrl + Shift+ Q