| title | Updated - T-SQL docs | Microsoft Docs |
|---|---|
| description | Display snippets of updated content for recently changed in documentation, for Transact-SQL. |
| services | na |
| documentationcenter | |
| author | MightyPen |
| manager | jhubbard |
| editor | BYHAM |
| ms.service | na |
| ms.topic | updart-autogen |
| ms.technology | database-engine |
| ms.custom | UpdArt.exe |
| ms.tgt_pltfrm | na |
| ms.devlang | na |
| ms.date | 09/11/2017 |
| ms.author | genemi |
| ms.workload | t-sql |
Nearly every day Microsoft updates some of its existing articles on its Docs.Microsoft.com documentation website. This article displays excerpts from recently updated articles. Links to new articles might also be listed.
This article is generated by a program that is rerun periodically. Occasionally an excerpt can appear with imperfect formatting, or as markdown from the source article. Images are never displayed here.
Recent updates are reported for the following date range and subject:
- Date range of updates: 2017-07-18 -to- 2017-09-11
- Subject area: T-SQL.
The following links jump to new articles that have been added recently.
- PREDICT (Transact-SQL)
- ALTER EXTERNAL LIBRARY (Transact-SQL)
- CREATE EXTERNAL LIBRARY (Transact-SQL)
- DROP EXTERNAL LIBRARY (Transact-SQL)
This section displays the excerpts of updates gathered from articles that have recently experienced a large update.
The excerpts displayed here appear separated from their proper semantic context. Also, sometimes an excerpt is separated from important markdown syntax that surrounds it in the actual article. Therefore these excerpts are for general guidance only. The excerpts only enable you to know whether your interests warrant taking the time to click and visit the actual article.
For these and other reasons, do not copy code from these excerpts, and do not take as exact truth any text excerpt. Instead, visit the actual article.
This compact list provides links to all the updated articles that are listed in the Excerpts section.
Updated: 2017-09-08
K. Using CAST with arithmetic operators
The following example calculates a single column computation by dividing the product unit price (UnitPrice) by the discount percentage (UnitPriceDiscountPct). This result is converted to an int data type after being rounded to the nearest whole number. Uses AdventureWorksDW.
SELECT ProductKey, UnitPrice,UnitPriceDiscountPct,
CAST(ROUND (UnitPrice*UnitPriceDiscountPct,0) AS int) AS DiscountPrice
FROM dbo.FactResellerSales
WHERE SalesOrderNumber = 'SO47355'
AND UnitPriceDiscountPct > .02;
..!NCLUDE-NotShown--ssResult--../../includes/ssresult-md.md)]
ProductKey UnitPrice UnitPriceDiscountPct DiscountPrice
---------- --------- -------------------- -------------
323 430.6445 0.05 22
213 18.5043 0.05 1
456 37.4950 0.10 4
456 37.4950 0.10 4
216 18.5043 0.05 1
L. Using CAST to concatenate
The following example concatenates noncharacter expressions by using CAST. Uses AdventureWorksDW.
SELECT 'The list price is ' + CAST(ListPrice AS varchar(12)) AS ListPrice
FROM dbo.DimProduct
WHERE ListPrice BETWEEN 350.00 AND 400.00;
..!NCLUDE-NotShown--ssResult--../../includes/ssresult-md.md)]
ListPrice
------------------------
The list price is 357.06
The list price is 364.09
The list price is 364.09
The list price is 364.09
The list price is 364.09
M. Using CAST to produce more readable text
The following example uses CAST in the SELECT list to convert the Name column to a char(10) column. Uses AdventureWorksDW.
SELECT DISTINCT CAST(EnglishProductName AS char(10)) AS Name, ListPrice
FROM dbo.DimProduct
WHERE EnglishProductName LIKE 'Long-Sleeve Logo Jersey, M';
..!NCLUDE-NotShown--ssResult--../../includes/ssresult-md.md)]
This section lists very similar articles for recently updated articles in other subject areas, within our public GitHub.com repository: MicrosoftDocs/sql-docs.
- New + Updated (3+12) : Advanced Analytics for SQL docs
- New + Updated (5+0) : Connect to SQL docs
- New + Updated (5+1) : Database Engine for SQL docs
- New + Updated (19+82): Integration Services for SQL docs
- New + Updated (1+8) : Linux for SQL docs
- New + Updated (12+1) : Relational Databases for SQL docs
- New + Updated (0+1) : Reporting Services for SQL docs
- New + Updated (7+1) : Microsoft SQL Server docs
- New + Updated (1+1) : SQL Server Data Tools (SSDT) docs
- New + Updated (0+2) : SQL Server Migration Assistant (SSMA) docs
- New + Updated (1+4) : SQL Server Management Studio (SSMS) docs
- New + Updated (4+1) : Transact-SQL docs
- New + Updated (0+1) : Tools for SQL docs
- New + Updated (0+0): ActiveX Data Objects (ADO) for SQL docs
- New + Updated (0+0): Analysis Services for SQL docs
- New + Updated (0+0): Data Quality Services for SQL docs
- New + Updated (0+0): Data Mining Extensions (DMX) for SQL docs
- New + Updated (0+0): Master Data Services (MDS) for SQL docs
- New + Updated (0+0): Multidimensional Expressions (MDX) for SQL docs
- New + Updated (0+0): ODBC (Open Database Connectivity) for SQL docs
- New + Updated (0+0): PowerShell for SQL docs
- New + Updated (0+0): Samples for SQL docs
- New + Updated (0+0): XQuery for SQL docs