Avatar of ttist25
ttist25
 asked on

T-SQL "Code Wrapping" in SSMS 2012

Hey there -

I'm writing a lot of one off scripts in SSMS during analysis of new datasets.  I'm trying to figure out a way to code wrap regions in SSMS.  I haven't found anything in searches other than plugin/addon stuff which I'd like to avoid.  

Does anyone have any tricks that would allow me to create a collapsable "region" anywhere in my code in SSMS.  

Something like:

SELECT
#RegionFields
this,
that,
the,
other
#/EndRegionFields
FROM
MyTable
WHERE
#RegionCriteria
this=that and
deez=doze and
so=on and
so=on
#EndRegionCriteria

So that anything between the #Regions would be collapsable.  

TIA!
Microsoft SQL Server

Avatar of undefined
Last Comment
ttist25

8/22/2022 - Mon
Pawan Kumar

In SQL Server we do not have anything like that.

#Region
....
#EndRegion

we have this in .NET

If we long code SQL automatically shows - ( hyphen )

click on that SQL collapse the long code.
ASKER CERTIFIED SOLUTION
Pawan Kumar

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ttist25

ASKER
Thank you Pawan!

That isn't exactly what I had envisioned but it definitely gets the job done.  

Thanks!
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck