{"id":851,"date":"2018-10-06T17:41:14","date_gmt":"2018-10-06T10:41:14","guid":{"rendered":"http:\/\/www.sqlservertutorial.net\/?page_id=851"},"modified":"2021-04-28T15:42:41","modified_gmt":"2021-04-28T08:42:41","slug":"sql-server-user-defined-functions","status":"publish","type":"page","link":"https:\/\/www.sqlservertutorial.net\/sql-server-user-defined-functions\/","title":{"rendered":"SQL Server User-defined Functions"},"content":{"rendered":"\n<p>In this section, you will learn about SQL Server user-defined functions including scalar-valued functions which return a single value and table-valued function which return rows of data.<\/p>\n\n\n\n<p>The SQL Server user-defined functions help you simplify your development by encapsulating complex business logic and make them available for reuse in every query.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-user-defined-functions\/sql-server-scalar-functions\/\">User-defined scalar functions<\/a> &#8211; cover the user-defined scalar functions that allow you to encapsulate complex formula or business logic and reuse them in every query.<\/li><li><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-user-defined-functions\/sql-server-table-variables\/\">Table variables<\/a> &#8211; learn how to use table variables as a return value of user-defined functions.<\/li><li><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-user-defined-functions\/sql-server-table-valued-functions\/\">Table-valued functions<\/a> &#8211; introduce you to inline table-valued function and multi-statement table-valued function to develop user-defined functions that return data of table types.<\/li><li><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-user-defined-functions\/sql-server-drop-function\/\">Removing user-defined functions<\/a> &#8211; learn how to drop one or more existing user-defined functions from the database.<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In this section, you will learn about SQL Server user-defined functions including scalar-valued functions and table-valued functions to simplify your development.<\/p>\n","protected":false},"author":1,"featured_media":2740,"parent":0,"menu_order":7,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-851","page","type-page","status-publish","has-post-thumbnail","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 User-defined Functions Tutorial with Practical Examples<\/title>\n<meta name=\"description\" content=\"You will learn about SQL Server user-defined functions including scalar-valued functions and table-valued functions to simplify your development.\" \/>\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-user-defined-functions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Server User-defined Functions Tutorial with Practical Examples\" \/>\n<meta property=\"og:description\" content=\"You will learn about SQL Server user-defined functions including scalar-valued functions and table-valued functions to simplify your development.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlservertutorial.net\/sql-server-user-defined-functions\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL Server Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-28T08:42: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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-user-defined-functions\\\/\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-user-defined-functions\\\/\",\"name\":\"SQL Server User-defined Functions Tutorial with Practical Examples\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-user-defined-functions\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-user-defined-functions\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/wp-content\\\/uploads\\\/sql-server-user-defined-functions.svg\",\"datePublished\":\"2018-10-06T10:41:14+00:00\",\"dateModified\":\"2021-04-28T08:42:41+00:00\",\"description\":\"You will learn about SQL Server user-defined functions including scalar-valued functions and table-valued functions to simplify your development.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-user-defined-functions\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-user-defined-functions\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-user-defined-functions\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/wp-content\\\/uploads\\\/sql-server-user-defined-functions.svg\",\"contentUrl\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/wp-content\\\/uploads\\\/sql-server-user-defined-functions.svg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-user-defined-functions\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Server User-defined Functions\"}]},{\"@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 User-defined Functions Tutorial with Practical Examples","description":"You will learn about SQL Server user-defined functions including scalar-valued functions and table-valued functions to simplify your development.","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-user-defined-functions\/","og_locale":"en_US","og_type":"article","og_title":"SQL Server User-defined Functions Tutorial with Practical Examples","og_description":"You will learn about SQL Server user-defined functions including scalar-valued functions and table-valued functions to simplify your development.","og_url":"https:\/\/www.sqlservertutorial.net\/sql-server-user-defined-functions\/","og_site_name":"SQL Server Tutorial","article_modified_time":"2021-04-28T08:42:41+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-user-defined-functions\/","url":"https:\/\/www.sqlservertutorial.net\/sql-server-user-defined-functions\/","name":"SQL Server User-defined Functions Tutorial with Practical Examples","isPartOf":{"@id":"https:\/\/www.sqlservertutorial.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-user-defined-functions\/#primaryimage"},"image":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-user-defined-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/sql-server-user-defined-functions.svg","datePublished":"2018-10-06T10:41:14+00:00","dateModified":"2021-04-28T08:42:41+00:00","description":"You will learn about SQL Server user-defined functions including scalar-valued functions and table-valued functions to simplify your development.","breadcrumb":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-user-defined-functions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlservertutorial.net\/sql-server-user-defined-functions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-user-defined-functions\/#primaryimage","url":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/sql-server-user-defined-functions.svg","contentUrl":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/sql-server-user-defined-functions.svg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-user-defined-functions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlservertutorial.net\/"},{"@type":"ListItem","position":2,"name":"SQL Server User-defined Functions"}]},{"@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\/851","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=851"}],"version-history":[{"count":1,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/851\/revisions"}],"predecessor-version":[{"id":2754,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/851\/revisions\/2754"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/media\/2740"}],"wp:attachment":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/media?parent=851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}