Solved

SQL Prompt CASE STATEMNENTS

Posted on 2016-08-18
7
56 Views
Last Modified: 2016-08-19
Where is the option to keep all column data on one line? but each column on a new line?

When formatting SQL in SQL Prompt it is wrapping my case statements

Example... it is doing this
MAX(CASE WHEN p.PhoneNumberTypeID = 1 THEN p.PhoneNumber
                  ELSE ''
      END) AS HomePhone ,

When I want this to be the default formatting
MAX(CASE WHEN p.PhoneNumberTypeID = 1 THEN p.PhoneNumber ELSE '' END) AS HomePhone ,
0
Comment
Question by:lrbrister
  • 3
  • 3
7 Comments
 
LVL 42

Accepted Solution

by:
zephyr_hex (Megan) earned 500 total points
ID: 41761153
There isn't a setting that controls the wrapping of a CASE statement in SQL Prompt.  If you look at the formatting options for CASE, it's pretty limited, and there is nothing for wrap control.

It looks like there was some discussion regarding some format options about a year ago.
0
 

Author Closing Comment

by:lrbrister
ID: 41761235
thanks
0
 

Expert Comment

by:Grant Fritchey
ID: 41762324
We've just released a new version of SQL Prompt, 7.3, into beta which has radically enhanced formatting capabilities. It will absolutely be able to do exactly what you're looking for here.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:lrbrister
ID: 41762327
Gary
Is that an auto update of my software?
0
 

Expert Comment

by:Grant Fritchey
ID: 41762374
It will be after it gets released. It's in beta right now, but will be out the door within a week or so.
0
 

Author Comment

by:lrbrister
ID: 41762383
Grant,
 Its a bit pricy.
My company allowed the license to lapse and no way they are spending the funds for that "renew"
0
 

Expert Comment

by:Grant Fritchey
ID: 41762396
Sorry. Can't help you there. I just wanted to let you know that we have the functionality you're looking for available now.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question