I wouldn't advise you to edit the XML directly, though, because the SQL Prompt style editor is so cute. I suggest that you edit your preferred style occasionally, because the Prompt Team is actively increasing the number of options and putting in corrections, and you can get a nice surprise when SQL Prompt suddenly gets closer to your preferences. Of course, you can still apply your own preferred style when you need to work on code, then reapply the team style just before committing your changes. You can save the styles in Source Control, which is especially useful if you're lucky enough to agree on a "common style" for the team. You can store your styles anywhere that can be reached by the filesystem, so you can share your preferred style with your colleagues, making it easier and quicker for them to disagree with it.
#Sql prompt 8 what's new code
You can see that the code styles are XML files with a whole plethora of settings: If you look in the line at the top of the Formatting Styles window (SQL Prompt | Active Style | Edit Style or SQL Prompt | Edit Formatting styles), you can see where they are currently stored (\%LOCALAPPDATA%\Red Gate\SQL Prompt 9\StylesV2). Once you have created your own style, you can hang onto it. No two developers can ever agree about how code should be formatted.Īfter haughtily rejecting all the other built-in styles, (SQL Prompt | Active Style. Well, no it doesn't, because I'm confident that you still don't like the way it is formatted. I have SQL Prompt, so I can hit Ctrl K -Ctrl Y (mnemonic 'Kick Yourself'), it applies its default built-in code style and that fixes that. If I need to understand and improve the code, I'll first need to get it into a readable form. ORDER BY SalesPerformance.SalesValue DESC INNER JOIN Person.Person AS bossperson ON bossperson.BusinessEntityID=boss.BusinessEntityID INNER JOIN HumanResources.Employee boss ON anizationNode= (1)
![sql prompt 8 what sql prompt 8 what](https://cdn.rd.gt/wp-content/uploads/2017/05/SQL-Prompt-style-tip-5-1024x686.png)
INNER JOIN HumanResources.Employee AS Employee ON Employee.BusinessEntityID = salesPerson.BusinessEntityID INNER JOIN Person.Person AS salesperson ON SalesPerson_id=SalesPerson.BusinessEntityID ORDER BY SUM(SalesOrderHeader.TotalDue) DESC) AS SalesPerformance(SalesPerson_ID, SalesValue) INNER JOIN Person.Person ON SalesPerson.BusinessEntityID=Person.BusinessEntityID
![sql prompt 8 what sql prompt 8 what](https://us.v-cdn.net/6029854/uploads/editor/iw/53znlwampmio.jpg)
INNER JOIN Sales.SalesOrderHeader ON SalesPerson.BusinessEntityID=SalesOrderHeader.SalesPersonID SUM(SalesOrderHeader.TotalDue) AS SalesValue
![sql prompt 8 what sql prompt 8 what](https://i.ytimg.com/vi/0rKPBp1F2Fk/maxresdefault.jpg)
+COALESCE(' '+BossPerson.Suffix, '')+ ' ('+boss.jobtitle+')' AS managerįROM(SELECT TOP 10 SalesPerson.BusinessEntityID AS salesPerson_ID, +COALESCE(' '+BossPerson.MiddleName, '')+' '+BossPerson.LastName +COALESCE(' '+SalesPerson.Suffix, '') AS SalesPerson,ĬOALESCE(BossPerson.Title+' ', '')+BossPerson.FirstName +COALESCE(' '+SalesPerson.MiddleName, '')+' '+SalesPerson.LastName SELECT SalesValue, COALESCE(SalesPerson.Title+' ', '')+SalesPerson.FirstName Here is some SQL code to reveal the highest-performing salespeople at AdventureWorks and listing their managers.