PATINDEXReturns the position of a pattern in a string QUOTENAMEReturns a Unicode string with delimiters added to make the string a valid SQL Server delimited identifier REPLACEReplaces all occurrences of a substring within a string, with a new substring ...
Like functions in programming languages, SQL Server user-defined functions are routines that accept parameters, perform an action, such as a complex calculation, and return the result of that action as a value. The return value can either be a single scalar value or a result set. Benefits of...
Scalar function examples Table-valued function examples Show 2 more Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics Analytics Platform System (PDW) This article describes how to create a user-defined function (UDF) in SQL Server by using Transact-SQL....
Validate, query, and change JSON data with built-in functions (SQL Server) Article 05/23/2024 15 contributors Feedback In this article JSON text for the examples on this page Validate JSON text by using the ISJSON function Extract a value from JSON text by using the JSON_VALUE function ...
Examples The code samples in this article use the AdventureWorks2022 or AdventureWorksDW2022 sample database, which you can download from the Microsoft SQL Server Samples and Community Projects home page. A. Return the results of a SQL Server query The following sample shows a table-valued functi...
Finally it is possible to perform a number of logical set operations using functions such asIntersect (MDX),Union (MDX)andExcept (MDX)functions. The following query shows examples of the latter two functions: SELECT //Returns a set containing the Measures Internet Sales Amount, Internet Tax Amou...
Functions Examples Examples: Azure Synapse Analytics and Analytics Platform System (PDW) See Also Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics Analytics Platform System (PDW) SQL analytics endpoint in Microsoft Fabric Warehouse in Microsoft FabricYou...
Examples A. Using an ODBC function in a stored procedure The following example uses an ODBC function in a stored procedure: SQL CREATEPROCEDUREdbo.ODBCprocedure ( @string_expNVARCHAR(4000) )ASSELECT{fnOCTET_LENGTH( @string_exp )}; B. Using an ODBC Function in a user-defined function ...
Scripts for registering and unregistering the functionality in SQL Server are included in the SQL Scripts directory. Detailed Steps: To Register: 1) Note the path to the SQLSpatialTools.dll file. 2) Edit the Register.sql file in the SQL Scripts directory: a) Insert the name of the data...
CHANGETABLE(CHANGES …) takes a last synchronization version as an argument. The last synchronization version is obtained using the@last_synchronization_versionvariable, as shown in the examples in this topic. The semantics of the last synchronization version are as follows: ...