{"id":3715,"date":"2024-04-04T09:53:09","date_gmt":"2024-04-04T02:53:09","guid":{"rendered":"https:\/\/www.sqlservertutorial.net\/?page_id=3715"},"modified":"2024-04-04T09:53:41","modified_gmt":"2024-04-04T02:53:41","slug":"sql-server-abs","status":"publish","type":"page","link":"https:\/\/www.sqlservertutorial.net\/sql-server-math-functions\/sql-server-abs\/","title":{"rendered":"SQL Server ABS() Function"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you will learn how to use the SQL Server <code>ABS()<\/code> function to return the absolute value of a number.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='sql-server-abs-function-syntax'>SQL Server ABS() function syntax <a href=\"#sql-server-abs-function-syntax\" class=\"anchor\" id=\"sql-server-abs-function-syntax\" title=\"Anchor for SQL Server ABS() function syntax\">#<\/a><\/h2>\n\n\n\n<p>The <code>ABS()<\/code> function returns the absolute (positive) values of a number. In other words, the <code>ABS()<\/code> function changes from a negative value to a positive value. It does not affect positive values or zero.<\/p>\n\n\n\n<p>Here&#8217;s the syntax of the <code>ABS()<\/code> function:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">ABS ( numeric_expression )<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this syntax, the <code>numeric_expression<\/code> is a number or an expression that you want to find the absolute value.<\/p>\n\n\n\n<p>The <code>ABS()<\/code> function returns the positive number of the input value with the type depending on the type of the input value. <\/p>\n\n\n\n<p>The following table shows the type of the input value with the corresponding type of the return value.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Input type<\/th><th>Return type<\/th><\/tr><\/thead><tbody><tr><td>float<strong>,&nbsp;<\/strong>real<\/td><td>float<\/td><\/tr><tr><td>decimal(p,&nbsp;s)<\/td><td>decimal(38,&nbsp;s)<\/td><\/tr><tr><td>int<strong>,&nbsp;<\/strong>smallint<strong>,&nbsp;<\/strong>tinyint<\/td><td>int<\/td><\/tr><tr><td>bigint<\/td><td>bigint<\/td><\/tr><tr><td>money,&nbsp;smallmoney<\/td><td>money<\/td><\/tr><tr><td>bit<\/td><td>float<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The <code>ABS()<\/code> function return null if the input value is <code>NULL<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='sql-server-abs-function-examples'>SQL Server ABS() function examples <a href=\"#sql-server-abs-function-examples\" class=\"anchor\" id=\"sql-server-abs-function-examples\" title=\"Anchor for SQL Server ABS() function examples\">#<\/a><\/h2>\n\n\n\n<p>Let&#8217;s explore some examples of using the <code>ABS()<\/code> function.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='1-basic-sql-server-abs-function-example'>1) Basic SQL Server ABS() function example <a href=\"#1-basic-sql-server-abs-function-example\" class=\"anchor\" id=\"1-basic-sql-server-abs-function-example\" title=\"Anchor for 1) Basic SQL Server ABS() function example\">#<\/a><\/h3>\n\n\n\n<p>The following example uses the <code>ABS<\/code> function to find the absolute values of negative numbers:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> <span class=\"hljs-keyword\">ABS<\/span>(<span class=\"hljs-number\">-10<\/span>) <span class=\"hljs-keyword\">result<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">result\n<span class=\"hljs-comment\">-----------<\/span>\n10<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id='2-using-abs-function-with-null'>2) Using ABS() function with NULL <a href=\"#2-using-abs-function-with-null\" class=\"anchor\" id=\"2-using-abs-function-with-null\" title=\"Anchor for 2) Using ABS() function with NULL\">#<\/a><\/h3>\n\n\n\n<p>The <code>ABS()<\/code> function will return <code>NULL<\/code> if the input value is <code>NULL<\/code>. For example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> <span class=\"hljs-keyword\">ABS<\/span>(<span class=\"hljs-literal\">NULL<\/span>) <span class=\"hljs-keyword\">result<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> <span class=\"hljs-keyword\">ABS<\/span>(<span class=\"hljs-literal\">NULL<\/span>) <span class=\"hljs-keyword\">result<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id='3-arithmetic-overflow-error-example'>3) Arithmetic overflow error example <a href=\"#3-arithmetic-overflow-error-example\" class=\"anchor\" id=\"3-arithmetic-overflow-error-example\" title=\"Anchor for 3) Arithmetic overflow error example\">#<\/a><\/h3>\n\n\n\n<p>When using the <code>ABS()<\/code> function, you may encouter an overflow error if you attempt to calculate the absolute value of a number that exceeds the maximum value representable by the specified type.<\/p>\n\n\n\n<p>For example, the int data type in SQL Server has a value range from -2,147,483,648 to 2,147,483,647. <\/p>\n\n\n\n<p>If you apply the the <code>ABS()<\/code> function to signed integer such as -2,147,483,648, you&#8217;ll encouter an overflow error because the absolute value exceeds the positive range limit for the int data type<\/p>\n\n\n\n<p>The following snippet illustrates the arithmetic overflow error:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">DECLARE<\/span> @x <span class=\"hljs-built_in\">INT<\/span>;  \n<span class=\"hljs-keyword\">SET<\/span> @x = <span class=\"hljs-number\">-2147483648<\/span>;  \n<span class=\"hljs-keyword\">SELECT<\/span> <span class=\"hljs-keyword\">ABS<\/span>(@x);  \nGO <\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">Arithmetic overflow error converting expression to data type int.<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id='4-using-the-abs-function-with-table-data'>4) Using the ABS function with table data <a href=\"#4-using-the-abs-function-with-table-data\" class=\"anchor\" id=\"4-using-the-abs-function-with-table-data\" title=\"Anchor for 4) Using the ABS function with table data\">#<\/a><\/h3>\n\n\n\n<p>First, <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-create-table\/\">create a table<\/a> called <code>temperature_readings<\/code> that store the temperature reading:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">TABLE<\/span> temperature_readings (\n     <span class=\"hljs-keyword\">id<\/span> <span class=\"hljs-built_in\">INT<\/span> <span class=\"hljs-keyword\">IDENTITY<\/span> PRIMARY <span class=\"hljs-keyword\">KEY<\/span>,\n     recorded_at DATETIME,\n     temperature <span class=\"hljs-built_in\">DECIMAL<\/span>(<span class=\"hljs-number\">5<\/span>, <span class=\"hljs-number\">2<\/span>)\n);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Second, <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-insert-multiple-rows\/\">insert rows<\/a> into the <code>temperature_readings<\/code> table:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">INSERT<\/span> <span class=\"hljs-keyword\">INTO<\/span>\n  temperature_readings (recorded_at, temperature)\n<span class=\"hljs-keyword\">VALUES<\/span>\n  (<span class=\"hljs-string\">'2024-04-04 08:00:00'<\/span>, <span class=\"hljs-number\">24.5<\/span>),\n  (<span class=\"hljs-string\">'2024-04-04 08:15:00'<\/span>, <span class=\"hljs-number\">25.2<\/span>),\n  (<span class=\"hljs-string\">'2024-04-04 08:30:00'<\/span>, <span class=\"hljs-number\">26.8<\/span>),\n  (<span class=\"hljs-string\">'2024-04-04 08:45:00'<\/span>, <span class=\"hljs-number\">23.9<\/span>),\n  (<span class=\"hljs-string\">'2024-04-04 09:00:00'<\/span>, <span class=\"hljs-number\">25.7<\/span>);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Third, calculate absolute temperature differences from the reference temperature, which is 25 degrees Celsius:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\n  recorded_at,\n  temperature,\n  <span class=\"hljs-keyword\">ABS<\/span>(temperature - <span class=\"hljs-number\">25<\/span>) <span class=\"hljs-keyword\">AS<\/span> temperature_diff_from_ref\n<span class=\"hljs-keyword\">FROM<\/span>\n  temperature_readings;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">recorded_at         | temperature | temperature_diff_from_ref\n<span class=\"hljs-comment\">--------------------+-------------+--------------------------<\/span>\n2024-04-04 08:00:00 | 24.50       | 0.50\n2024-04-04 08:15:00 | 25.20       | 0.20\n2024-04-04 08:30:00 | 26.80       | 1.80\n2024-04-04 08:45:00 | 23.90       | 1.10\n2024-04-04 09:00:00 | 25.70       | 0.70\n(5 rows)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the <code>ABS()<\/code> function to return the absolute value of a number.<\/li>\n<\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"3715\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqlservertutorial.net\/sql-server-math-functions\/sql-server-abs\/\"\n\t\t\t\tdata-post-title=\"SQL Server ABS() Function\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"3715\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqlservertutorial.net\/sql-server-math-functions\/sql-server-abs\/\"\n\t\t\t\tdata-post-title=\"SQL Server ABS() Function\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you will learn how to use the SQL Server ABS() function to return the absolute value of a number.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3680,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-3715","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SQL Server ABS() Function<\/title>\n<meta name=\"description\" content=\"In this tutorial, you will learn how to use the SQL Server ABS() function to return the absolute value of a number.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlservertutorial.net\/sql-server-math-functions\/sql-server-abs\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Server ABS() Function\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, you will learn how to use the SQL Server ABS() function to return the absolute value of a number.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlservertutorial.net\/sql-server-math-functions\/sql-server-abs\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL Server Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-04T02:53:41+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-math-functions\\\/sql-server-abs\\\/\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-math-functions\\\/sql-server-abs\\\/\",\"name\":\"SQL Server ABS() Function\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/#website\"},\"datePublished\":\"2024-04-04T02:53:09+00:00\",\"dateModified\":\"2024-04-04T02:53:41+00:00\",\"description\":\"In this tutorial, you will learn how to use the SQL Server ABS() function to return the absolute value of a number.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-math-functions\\\/sql-server-abs\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-math-functions\\\/sql-server-abs\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-math-functions\\\/sql-server-abs\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Server Math Functions\",\"item\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-math-functions\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"SQL Server ABS() Function\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/#website\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/\",\"name\":\"SQL Server Tutorial\",\"description\":\"The Practical SQL Server Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL Server ABS() Function","description":"In this tutorial, you will learn how to use the SQL Server ABS() function to return the absolute value of a number.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlservertutorial.net\/sql-server-math-functions\/sql-server-abs\/","og_locale":"en_US","og_type":"article","og_title":"SQL Server ABS() Function","og_description":"In this tutorial, you will learn how to use the SQL Server ABS() function to return the absolute value of a number.","og_url":"https:\/\/www.sqlservertutorial.net\/sql-server-math-functions\/sql-server-abs\/","og_site_name":"SQL Server Tutorial","article_modified_time":"2024-04-04T02:53:41+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-math-functions\/sql-server-abs\/","url":"https:\/\/www.sqlservertutorial.net\/sql-server-math-functions\/sql-server-abs\/","name":"SQL Server ABS() Function","isPartOf":{"@id":"https:\/\/www.sqlservertutorial.net\/#website"},"datePublished":"2024-04-04T02:53:09+00:00","dateModified":"2024-04-04T02:53:41+00:00","description":"In this tutorial, you will learn how to use the SQL Server ABS() function to return the absolute value of a number.","breadcrumb":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-math-functions\/sql-server-abs\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlservertutorial.net\/sql-server-math-functions\/sql-server-abs\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-math-functions\/sql-server-abs\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlservertutorial.net\/"},{"@type":"ListItem","position":2,"name":"SQL Server Math Functions","item":"https:\/\/www.sqlservertutorial.net\/sql-server-math-functions\/"},{"@type":"ListItem","position":3,"name":"SQL Server ABS() Function"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlservertutorial.net\/#website","url":"https:\/\/www.sqlservertutorial.net\/","name":"SQL Server Tutorial","description":"The Practical SQL Server Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlservertutorial.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/3715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/comments?post=3715"}],"version-history":[{"count":4,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/3715\/revisions"}],"predecessor-version":[{"id":3719,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/3715\/revisions\/3719"}],"up":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/3680"}],"wp:attachment":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/media?parent=3715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}