Tutorialsteacher

Follow Us

Articles
  • C#
  • C# OOP
  • ASP.NET Core
  • ASP.NET MVC
  • LINQ
  • Inversion of Control (IoC)
  • Web API
  • JavaScript
  • TypeScript
  • jQuery
  • Angular 11
  • Node.js
  • D3.js
  • Sass
  • Python
  • Go lang
  • HTTPS (SSL)
  • Regex
  • SQL
  • SQL Server
  • PostgreSQL
  • MongoDB
  • SQL Server - Get Started
  • Install SQL Server
  • SQL Server Management Studio
  • SQL Server - Windows Authentication
  • SQL Server - Authentication
  • SQL Server - Create New User
  • SQL Server - GRANT/REVOKE Permissions to User
  • SQL Server - Data Types
  • SQL Server - Naming Conventions
  • SQL Server - CREATE Database
  • SQL Server - CREATE Table
  • Add Columns
  • Identity Column
  • Rename Column, Table
  • Drop Columns
  • SQL Server - Schema
  • SQL Server - Tables Relations
  • SQL Server - Primary Keys
  • Modify/Delete Primary Keys
  • SQL Server - Foreign Keys
  • Modify/Delete Foreign Keys
  • SQL Server - Check Constraints
  • SQL Server - Unique Constraints
  • SQL Server - Views
  • Modify/Delete Views
  • SQL Server - Functions
  • SQL Server - Stored Procedures
  • Stored Procedure Parameters
  • SQL Server - Indexes
  • Non-clustered Indexes
  • Modify/Delete Indexes
  • SQL Server - Triggers
  • DDL Triggers
  • LOGON Triggers
  • Enable/Disable Triggers
  • Modify/Delete Triggers
  • SQL Server - Sequence
  • SQL Server - Synonyms
  • SQL Server - IF ELSE Statement
  • SQL Server - Loops
  • SQL Server - Insert Data
  • SQL Server - Update Data
  • SQL Server - Delete Data
  • SQL Server - Select Query
  • WHERE Clause
  • GROUP BY Clause
  • HAVING Clause
  • ORDER BY Clause
  • SQL Server - Inner Join
  • Left Join
  • Right Join
  • Full Join
  • Self Join
  • Dynamic SQL
  • Built-in Functions
Entity Framework Extensions - Boost EF Core 9
  Bulk Insert
  Bulk Delete
  Bulk Update
  Bulk Merge

SQL Server Built-in Functions

The following is the list of built-in String functions, DateTime functions, Numeric functions and conversion functions.

String Functions

FunctionDescription
ASCIIReturns the ASCII code value for the leftmost character of a character expression.
CHARReturns a character for an ASCII value.
CHARINDEXSearches for one character expression within another character expression and returns the starting position of the first expression.
CONCATConcatenates two or more string values in an end to end manner and returns a single string.
LEFTReturns a given number of characters from a character string starting from the left
LENReturns a specified number of characters from a character string.
LOWERConverts a string to lower case.
LTRIMRemoves all the leading blanks from a character string.
NCHARReturns the Unicode character with the specified integer code, as defined by the Unicode standard.
PATINDEXReturns the starting position of the first occurrence of the pattern in a given string.
REPLACEReplaces all occurrences of a specified string with another string value.
RIGHTReturns the right part of a string with the specified number of characters.
RTRIMReturns a string after truncating all trailing spaces.
SPACEReturns a string of repeated spaces.
STRReturns character data converted from numeric data. The character data is right justified, with a specified length and decimal precision.
STUFFInserts a string into another string. It deletes a specified length of characters from the first string at the start position and then inserts the second string into the first string at the start position.
SUBSTRINGReturns part of a character, binary, text, or image expression
UPPERConverts a lowercase string to uppercase.

DateTime Functions

FunctionDescription
CURRENT_TIMESTAMPReturns the current system date and time of the computer on which the SQL server instance is installed. Time zone is not included.
DATEADDReturns a new datetime value by adding an interval to the specified datepart of the specified date
DATEDIFFReturns the difference in datepart between two given dates.
DATENAMEReturns a datepart as a character string.
DATEPARTReturns a datepart as an integer
DAYReturns the Day as an integer representing the Day part of a specified date.
GETDATEReturns a datetime value containing the date and time of the computer on which the SQL Server instance is installed. It does not include the time zone.
GETUTCDATEReturns a datetime value in UTC format (Coordinated Universal Time), containing the date and time of the computer on which the SQL Server instance is installed.
MONTHReturns the Month as an integer representing the Month part of a specified date.
YEARReturns the Year as an integer representing the Year part of a specified date.
ISDATEDetermines whether the input is a valid date, time or datetime value.

Numeric Functions

FunctionDescription
ABSReturns the absolute value of a number.
AVGReturns the average value of an expression/column values.
CEILINGReturns the nearest integer value which is larger than or equal to the specified decimal value.
COUNTReturns the number of records in the SELECT query.
FLOORReturns the largest integer value that is less than or equal to a number. The return value is of the same data type as the input parameter.
MAXReturns the maximum value in an expression.
MINReturns the minimum value in an expression.
RANDReturns a random floating point value using an optional seed value.
ROUNDReturns a numeric expression rounded to a specified number of places right of the decimal point.
SIGNReturns an indicator of the sign of the input integer expression.
SUMReturns the sum of all the values or only the distinct values, in the expression. NULL values are ignored.

Conversion Functions

FunctionDescription
CASTConverts a value of any type to a specified data type.
CONVERTConverts and formats a value of one data type to another data type.
TRY_CASTReturns a value cast to a specified data type if the cast succeeds else returns null.
TRY_CONVERTReturns a value cast to a specified data type if the cast succeeds else returns null.

Advanced Functions

FunctionDescription
IIFIt can be used as if-else condition in a query.
ISNULLReplaces the NULL value with a given replacement expression.
ISNUMERICDetermines whether the given expression is a valid numeric type or not.
USER_NAMEReturns the current logged-in user name.
TUTORIALSTEACHER.COM

TutorialsTeacher.com is your authoritative source for comprehensive technologies tutorials, tailored to guide you through mastering various web and other technologies through a step-by-step approach.

Our content helps you to learn technologies easily and quickly for learners of all levels. By accessing this platform, you acknowledge that you have reviewed and consented to abide by our Terms of Use and Privacy Policy, designed to safeguard your experience and privacy rights.

[email protected]

ABOUT USTERMS OF USEPRIVACY POLICY
copywrite-symbol

2024 TutorialsTeacher.com. (v 1.2) All Rights Reserved.