SQL Server 2008 / 2012 - views & sql formatting -


hopefully newbie question.

so if have kind of long set of selects in sql , couple of sub-selects within clause, i'm less satisfied formatting in view designer, appears way display/show views after saved.

so, in short, there way directly edit views within ssms, , have views retain formatting in code?

i.e.;

select case /*comment */   when = 5      b = 2     else b = 4  /* why b 4 */   end field_1,   dt field_2,... 

get's mashed up

select case /*comment */     when = 5                   b = 2                 else b = 4  /* why b 4 */               end field_1,              dt field_2,... 

or along lines.

are using query designer? instead, use ssms query window. ssms object explorer, right-click on view , select script view as-->alter to-->new query editor window. format view source in query window , run script change view. formatting preserved.


Comments

Popular posts from this blog

php - Admin SDK -- get information about the group -

dns - How To Use Custom Nameserver On Free Cloudflare? -

Python Error - TypeError: input expected at most 1 arguments, got 3 -