In SQL Server, the T-SQL CHAR() function converts an int ASCII code to a character value. In other words, you pass in an integer, and the function interprets it as the code value for a string character and returns the corresponding string character.
SQL Server
Create a SQL Server Database with Azure Data Studio
Here, I explain how to use Azure Data Studio (formerly SQL Operations Studio) to create a database in SQL Server.
In my case, I’m running SQL Server on a Mac (via a Docker container), but these instructions are generic and should work exactly the same way on Linux and Windows.
This tutorial assumes you already have Azure Data Studio installed on your machine, and you’ve connected to your SQL Server instance. If you don’t have Azure Data Studio installed on your machine, here are instructions for installing it on a Mac and connecting to SQL Server via Docker. The Azure Data Studio installation is pretty straightforward (you install it just like any other software), so if you’re on Linux or Windows, you shouldn’t have any issues.
How to Restore a SQL Server Database on a Mac using Azure Data Studio
Restoring a database is a piece of cake with Azure Data Studio. It’s a similar process to doing it with SQL Server Management Studio. Simply click Restore and follow the prompts.
This restore process allows you to navigate through the computer’s file system to locate the .bak file. This .bak file contains a backup of the database you want to restore. So when SQL Server restores the database, it’s using the .bak file to do so.
However, if you’re running your SQL Server instance inside a Docker container (which of course, you would be if you’re running SQL Server on Mac or Linux), there’s something you need to be aware of if your backup file is located outside the Docker container.
How to Install Azure Data Studio on a Mac
Azure Data Studio (previously known as SQL Operations Studio) is a free tool that you can use to manage SQL Server. It uses a graphical user interface (GUI) that helps you view the various databases and objects within a SQL Server instance. It can run on Windows, macOS, and Linux, and it’s also designed to be used with Azure SQL Database, and Azure SQL Data Warehouse.
Here I explain how to install Azure Data Studio onto a Mac, then how to use it to connect to SQL Server.
What is Azure Data Studio?
Microsoft Azure Data Studio is a free, cross-platform tool that can be used to manage SQL Server, Azure SQL Database, and Azure SQL Data Warehouse.
Azure Data Studio was formerly called SQL Operations Studio (while it was in preview release), and it was renamed to Azure Data Studio once it was moved to general availability (GA) on September 24, 2018.
SQL Server Mathematical Functions (Full List)
Transact-SQL contains a number of mathematical functions that you can use with SQL Server.
The following scalar functions can be used in SQL Server 2012 and above. Most of these functions accept one or more arguments, and will return a numeric value based on the argument/s supplied.
TAN() Examples in SQL Server
In SQL Server, the TAN() function returns the tangent of the input expression.
You provide the value as an argument when calling the function.
SQUARE() Examples in SQL Server
Using SQL Server, you can use the T-SQL SQUARE() function to return the square of a specified float value. The square of a number is the result of multiplying the number by itself.
You provide the number as an argument when calling the function.
The return data type is float.
SQRT() Examples in SQL Server
Using SQL Server, you can use the T-SQL SQRT() function to return the square root of a specified float value.
You provide the number as an argument when calling the function.
The return data type is float.
SIN() Examples in SQL Server
Using SQL Server, you can use the T-SQL SIN() function to return the sine of a number. More specifically, this function returns the trigonometric sine of the specified angle, in radians, and in an approximate numeric, float, expression.
The return data type is float.
You provide the number as an argument when calling the function.