{"id":6660,"date":"2022-03-08T06:16:00","date_gmt":"2022-03-08T05:16:00","guid":{"rendered":"https:\/\/expert-only.com\/?p=6660"},"modified":"2022-04-11T13:52:52","modified_gmt":"2022-04-11T11:52:52","slug":"manage-sql-server-user-defined-functions","status":"publish","type":"post","link":"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/","title":{"rendered":"Manage SQL Server user defined functions"},"content":{"rendered":"\n<p><strong>How to manage SQL Server user defined functions ? SQL Server user-defined functions are very useful when starting T-SQL development. You need to use them very often so you have to learn the right syntaxes and avoid errors. At the beginning it can be tricky and frustrating because it&#8217;s binary, it work or don&#8217;t work, programming T-SQL functions is an exact science. <\/strong><\/p>\n\n\n\n<p>There is two types of SQL Server functions which are the user-defined functions and the built-in functions. In this article we&#8217;ll see how to manage the user defined functions, in other words how to create, modify and delete functions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to manage a SQL Server user defined functions ?<\/h2>\n\n\n\n<p><b>First things first, what is an SQL Server function?<\/b><\/p>\n\n\n\n<p>An SQL Server function is a Transact-SQL program that takes input parameters, performs actions, like reading a table, or performing a calculation and returns the result as an output.&nbsp;The input and output is the main difference between functions and stored procedures. Indeed, functions returns results when stored procedure don&#8217;t necessarily do.<\/p>\n\n\n\n<p>Here are code samples to manage SQL Server functions:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><a href=\"#pid01\"> Create the Customers sample table<\/a><\/li><li><a href=\"#pid02\">Create an SQL Server user-defined function<\/a><\/li><li><a href=\"#pid03\">Modify an SQL Server function<\/a><\/li><li><a href=\"#pid04\">Delete an SQL Server function<\/a><\/li><li><a href=\"#pid05\">Test the existence of a function before deletion<\/a><\/li><li><a href=\"#pid06\">Call a function<\/a><\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"pid01\">1. Create the Customers sample table used by the function<\/h3>\n\n\n\n<p>Before you start using the SQL queries to manage the functions, create these sample Customers table, all instructions are available here. Just copy and paste and execute the script:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">-- If the Customers table already exists, then we drop it\nIF exists(   \n\tSELECT  1 FROM sys.objects\n\tWHERE   object_id = object_id(N'[dbo].[CUSTOMERS]') AND type in (N'U')\n)\nBEGIN\n\tDROP TABLE [dbo].[CUSTOMERS]\nEND\nGO\n\n-- We Create the CUSTOMERS table with the Column [Name] declared as Unique\n-- The UNIQUE keyword don't allow to have two different customers with the same name\nCREATE TABLE [dbo].[CUSTOMERS] (\n\t[CustomerNumber] \t INTEGER IDENTITY(1,1),\n\t[Name] \tNVARCHAR(20) UNIQUE,\n\t[City] \tNVARCHAR(20)\n)\nGO\n\n-- Data insertion for the function example\nINSERT INTO dbo.CUSTOMERS ( [Name], [City] ) VALUES ( N'John', 'New York');\nINSERT INTO dbo.CUSTOMERS ( [Name], [City] ) VALUES ( N'Ahmed', 'Los Angeles');\nINSERT INTO dbo.CUSTOMERS ( [Name], [City] ) VALUES ( N'Jane', 'Miami');\nINSERT INTO dbo.CUSTOMERS ( [Name], [City] ) VALUES ( N'Lee', 'Chicago');\nINSERT INTO dbo.CUSTOMERS ( [Name], [City] ) VALUES ( N'Diana', 'San Francisco');\n\n-- Let's verify the inserted lines for our 5 customers\nSELECT * \nFROM dbo.CUSTOMERS;\n\n<\/pre>\n\n\n\n<p>To go further for the tables, these articles shows <a href=\"https:\/\/expert-only.com\/en\/t-sql\/calculate-time-difference-hours-minutes-seconds-sql-server\/\">examples on how to calculate time between two dates in T-SQL<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"pid02\">2. How to create a SQL Server function?<\/h3>\n\n\n\n<p>This function takes as a parameter the customer number and returns the customer name. The result is stored in the @ClientName variable.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">CREATE FUNCTION dbo.ufnDisplayCustomers(@CustomerNumber INTEGER)\nRETURNS NVARCHAR(20)\nAS \nBEGIN \n  DECLARE\t@ClientName\tAS NVARCHAR(20);\n  SELECT\t@ClientName = [Name]\n  FROM\t\t[dbo].[CUSTOMERS]\n  WHERE\t\t[CustomerNumber] = @CustomerNumber;\n  RETURN\t@ClientName;\nEND\nGO\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"pid03\">3. How to alter or modify a SQL Server function?<\/h3>\n\n\n\n<p>To update the code of your function without deleting it, you can modify it or alter it using the ALTER command. This altered version is updating the function we just created above, so this time it&#8217;s returning not only the customer name, but also the customer city, separated with a dash, the result is stored in the @NameCityCustomer variable.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ALTER FUNCTION dbo.ufnDisplayCustomers(@CustomerNumber INTEGER)\nRETURNS NVARCHAR(40)\nAS \nBEGIN \n  DECLARE\t@NameCityCustomer\tAS NVARCHAR(20);\n  SELECT\t@NameCityCustomer = [Name] + '-' + [City] \n  FROM\t\t[dbo].[CUSTOMERS]\n  WHERE\t\t[CustomerNumber] = @CustomerNumber;\n  RETURN\t@NameCityCustomer;\nEND\nGO\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"pid04\">4. How to drop or delete a SQL Server function?<\/h3>\n\n\n\n<p>This SQL command delete the SQL Server function, nevertheless it&#8217;s not checking if the function exists.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">DROP FUNCTION ufnDisplayCustomers;\nGO\n<\/pre>\n\n\n\n<p>If the function was not actually existing in your databse, then you face this error:<\/p>\n\n\n\n<p><strong>Msg 3701, Level 11, State 5, Line 1<\/strong><br><strong>Cannot drop the function &#8216;ufnDisplayCustomers&#8217;, because it does not exist or you do not have permission.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"pid05\">5. How to check if user defined function exists in Sql Server ?<\/h3>\n\n\n\n<p>To avoid the error above, add an existence check in the SQL command. If the function actually exist in the database then it&#8217;s dropped, otherwise the &#8220;drop function&#8221; command is not executed.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">IF OBJECT_ID (N'dbo.ufnDisplayCustomers', N'FN') IS NOT NULL  \n    DROP FUNCTION ufnDisplayCustomers;  \nGO\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">The DROP FUNCTION IF EXISTS option<\/h4>\n\n\n\n<p>Since SQL Server 2016, it more easy to drop a database object. Simply use these one line code: <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">DROP FUNCTION IF EXISTS ufnDisplayCustomers;\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"pid06\">6. How to call&nbsp;a SQL Server&nbsp;user-defined&nbsp;function ?<\/h3>\n\n\n\n<p>Finally, to call an SQL Server function, you can use a SELECT statement followed by the name of the function, and also the input parameter value in brackets. In this query, the input parameter is the customer number you are displaying.<\/p>\n\n\n\n<p>This first version is returning &#8220;John&#8221; and the column name is the default one&nbsp;&#8220;<strong>(No column name)<\/strong>&#8220;.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT dbo.ufnDisplayCustomers(1);\n<\/pre>\n\n\n\n<p>To finish, this second version of the command is similar and it names explicitly the column as &#8220;<strong>CUSTOMER<\/strong>&#8220;.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT dbo.ufnDisplayCustomers(1) AS CUSTOMER;\n<\/pre>\n\n\n\n<p>To read more informations about the SQL Server functions, check out and read the Microsoft SQL Server <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/relational-databases\/user-defined-functions\/user-defined-functions?view=sql-server-2017\" target=\"_blank\" rel=\"noopener noreferrer\">official documentation<\/a>, available here:<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>How to manage SQL Server user defined functions ? SQL Server user-defined functions are very useful when starting T-SQL development. You need to use them very often so you have to learn the right syntaxes and avoid errors. At <a class=\"mh-excerpt-more\" href=\"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/\" title=\"Manage SQL Server user defined functions\">&#8230;<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":5584,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[454],"tags":[627,630],"class_list":{"0":"post-6660","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-t-sql","8":"tag-create-en-2","9":"tag-drop"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.7 (Yoast SEO v26.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Manage SQL Server user defined functions - T-SQL<\/title>\n<meta name=\"description\" content=\"How to manage SQL Server user defined functions ? It allows users to organize and reuse T-SQL code and return results for example.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/expert-only.com\/en\/t-sql\/manage-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=\"Manage SQL Server user defined functions\" \/>\n<meta property=\"og:description\" content=\"How to manage SQL Server user defined functions ? It allows users to organize and reuse T-SQL code and return results for example.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL and IT Tutorials\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-03-08T05:16:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-04-11T11:52:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/expert-only.com\/wp-content\/uploads\/2018\/09\/light-bulb-0B51D6AF710_1920x1080.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Expert-Only\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@expert_only\" \/>\n<meta name=\"twitter:site\" content=\"@expert_only\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Expert-Only\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/\"},\"author\":{\"name\":\"Expert-Only\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\"},\"headline\":\"Manage SQL Server user defined functions\",\"datePublished\":\"2022-03-08T05:16:00+00:00\",\"dateModified\":\"2022-04-11T11:52:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/\"},\"wordCount\":615,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2018\/09\/light-bulb-0B51D6AF710_1920x1080.jpeg\",\"keywords\":[\"create\",\"drop\"],\"articleSection\":[\"T-SQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/\",\"url\":\"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/\",\"name\":\"Manage SQL Server user defined functions - T-SQL\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2018\/09\/light-bulb-0B51D6AF710_1920x1080.jpeg\",\"datePublished\":\"2022-03-08T05:16:00+00:00\",\"dateModified\":\"2022-04-11T11:52:52+00:00\",\"description\":\"How to manage SQL Server user defined functions ? It allows users to organize and reuse T-SQL code and return results for example.\",\"breadcrumb\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/#primaryimage\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2018\/09\/light-bulb-0B51D6AF710_1920x1080.jpeg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2018\/09\/light-bulb-0B51D6AF710_1920x1080.jpeg\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"en\",\"item\":\"https:\/\/expert-only.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Manage SQL Server user defined functions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/expert-only.com\/en\/#website\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"name\":\"SQL and IT Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/expert-only.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/expert-only.com\/en\/#organization\",\"name\":\"Expert-Only\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"width\":381,\"height\":174,\"caption\":\"Expert-Only\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\",\"https:\/\/x.com\/expert_only\",\"https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\",\"name\":\"Expert-Only\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"caption\":\"Expert-Only\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Manage SQL Server user defined functions - T-SQL","description":"How to manage SQL Server user defined functions ? It allows users to organize and reuse T-SQL code and return results for example.","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:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/","og_locale":"en_US","og_type":"article","og_title":"Manage SQL Server user defined functions","og_description":"How to manage SQL Server user defined functions ? It allows users to organize and reuse T-SQL code and return results for example.","og_url":"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/","og_site_name":"SQL and IT Tutorials","article_publisher":"https:\/\/www.facebook.com\/ExpertOnlyCom\/","article_published_time":"2022-03-08T05:16:00+00:00","article_modified_time":"2022-04-11T11:52:52+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/expert-only.com\/wp-content\/uploads\/2018\/09\/light-bulb-0B51D6AF710_1920x1080.jpeg","type":"image\/jpeg"}],"author":"Expert-Only","twitter_card":"summary_large_image","twitter_creator":"@expert_only","twitter_site":"@expert_only","twitter_misc":{"Written by":"Expert-Only","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/#article","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/"},"author":{"name":"Expert-Only","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef"},"headline":"Manage SQL Server user defined functions","datePublished":"2022-03-08T05:16:00+00:00","dateModified":"2022-04-11T11:52:52+00:00","mainEntityOfPage":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/"},"wordCount":615,"commentCount":0,"publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"image":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2018\/09\/light-bulb-0B51D6AF710_1920x1080.jpeg","keywords":["create","drop"],"articleSection":["T-SQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/","url":"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/","name":"Manage SQL Server user defined functions - T-SQL","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/#primaryimage"},"image":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2018\/09\/light-bulb-0B51D6AF710_1920x1080.jpeg","datePublished":"2022-03-08T05:16:00+00:00","dateModified":"2022-04-11T11:52:52+00:00","description":"How to manage SQL Server user defined functions ? It allows users to organize and reuse T-SQL code and return results for example.","breadcrumb":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/#primaryimage","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2018\/09\/light-bulb-0B51D6AF710_1920x1080.jpeg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2018\/09\/light-bulb-0B51D6AF710_1920x1080.jpeg","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-user-defined-functions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"en","item":"https:\/\/expert-only.com\/en\/"},{"@type":"ListItem","position":2,"name":"Manage SQL Server user defined functions"}]},{"@type":"WebSite","@id":"https:\/\/expert-only.com\/en\/#website","url":"https:\/\/expert-only.com\/en\/","name":"SQL and IT Tutorials","description":"","publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/expert-only.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/expert-only.com\/en\/#organization","name":"Expert-Only","url":"https:\/\/expert-only.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","width":381,"height":174,"caption":"Expert-Only"},"image":{"@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ExpertOnlyCom\/","https:\/\/x.com\/expert_only","https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA"]},{"@type":"Person","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef","name":"Expert-Only","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","caption":"Expert-Only"}}]}},"_links":{"self":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/6660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/comments?post=6660"}],"version-history":[{"count":0,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/6660\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media\/5584"}],"wp:attachment":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media?parent=6660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/categories?post=6660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/tags?post=6660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}