SQL SPACE is a string function that replicates the number blanks that you want add to the given string.




SYNTAX

SPACE(number)

number is an integer value.

Lets look at an example of  SQL SPACE Function.

The following example concatenates, two string  ‘Micorsoft Sql server’ , 15 spaces and ‘2017’

SELECT 'Microsoft SQL SERVER'+SPACE(15)+'2017' as Output

 

Lets try to do same example without using SPACE function.

SELECT 'Microsoft SQL SERVER'+ '                ' +'2017' as Output

 

Also Read..

SQL Server String Functions

LEAD()

LAG()

FIRST_VALUE()

LAST_VALUE()

SQL Basics TutorialSQL Advance TutorialSSRSInterview Q & A
SQL Create tableSQL Server Stored ProcedureCreate a New SSRS Project List Of SQL Server basics to Advance Level Interview Q & A
SQL ALTER TABLESQL Server MergeCreate a Shared Data Source in SSRSSQL Server Question & Answer Quiz
SQL DropSQL Server PivotCreate a SSRS Tabular Report / Detail Report
..... More.... More....More
Power BI TutorialAzure TutorialPython TutorialSQL Server Tips & Tricks
Download and Install Power BI DesktopCreate an Azure storage accountLearn Python & ML Step by stepEnable Dark theme in SQL Server Management studio
Connect Power BI to SQL ServerUpload files to Azure storage containerSQL Server Template Explorer
Create Report ToolTip Pages in Power BICreate Azure SQL Database ServerDisplaying line numbers in Query Editor Window
....More....More....More
 




 240 total views,  1 views today

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.