FORMATMESSAGE statement is enhanced in SQL Server 2016 to accept a msg_string argument. In the previous versions this function was used to form a message from text located in sys.messages
This is Part 9 of 10 Part T-SQL Enhancements in SQL Server 2016 for Developers and DBAs. Click here to read it from the beginning….
DECLARE @ExampleMessage VARCHAR(150)
SET @ExampleMessage = FORMATMESSAGE ('SQL Server %s, has some amazing new features and learn
them on %s!', '2016', 'MyTechMantra.com');
SELECT @ExampleMessage;

Trending SQL Server Articles and Tips
- How to Backup and Restore Resource Database in SQL Server
- Display Line Numbers in SQL Server Management Studio (SSMS)
- STRING_SPLIT Function and STRING_ESCAPE Function in SQL Server 2016
- TRUNCATE TABLE WITH PARTITIONS T-SQL Enhancement in SQL Server 2016
- How to Download WideWorldImporters Sample Database and Restore in SQL Server 2016
Clicking Next Page button to continue reading the topics and click on the Previous Page button to revisit the previous topic.
Related Topics
- SERVERPROPERTY Function
- TRUNCATE TABLE WITH PARTITIONS
- DROP IF EXISTS
- ALTER TABLE WITH (ONLINE = ON | OFF)
- MAXDOP for DBCC CHECKDB, DBCC CHECKTABLE and DBCC CHECKFILEGROUP
- ALTER DATABASE SET AUTOGROW_SINGLE_FILE
- ALTER DATABASE SET AUTOGROW_ALL_FILES
- COMPRESS and DECOMPRESS Functions
- STRING_SPLIT and STRING_ESCAPE Functions
- FORMATMESSAGE Statement