sql server - Define code sections in sql managment studio -
i have long script in sql. i'm working ssms 2012 , sql servr 2012.
the sturctre somewhere this:
--loans_group --2013 create view loans_2013 ( select * x yr=2013 ) go --2014 create view loans_2014 ( select * x yr=2014 ) go --2015 create view loans_2015 ( select * x yr=2015 ) go --2016 create view loans_2016 ( select * x yr=2016 ) go --2017 create view loans_2017 ( select * x yr=2017 ) go --credit scoring group --2013 create view cs ( select * y yr=2013 ) go --2014 create view cs yr=2014 ( select * y ) go --2015 create view cs ( select * y yr=2015 ) go --2016 create view cs yr=2016 ( select * y ) go --2017 create view cs yr=2017 ( select * y ) go create view loans_join ( select * loans_2013 union select * loans_2014 union select * loans_2015 union select * loans_2016 union select * loans_2017 ) select * loans_join_table loans_join create view cs_join ( select * cs_2013 union select * cs_2014 union select * cs_2015 union select * cs_2016 union select * cs_2017 ) select * cs_join_table cs_join create view flatfile ( select * loans_join left join cs_join on loans_join.cust = cs_join.cust )
now, suppose create analysis table 2014-2015. in order need comment parts of code of other years... including parts in views union-ing views years - loans_join , cs_join. in real code there 20 groups beside loans , cs. there reason why in order create analysis table i'm dividing parts of years , not using parameters. it's little long me here reasons. i'm asking easy way can set code sections , comment them when execute query. this:
set code sections = (2013,2014,2015,2016,2017) comment code_sections = (2014,2015) , press f5 key.. know option that?
Comments
Post a Comment