SPACE function in SQL Server accepts integers as input parameters. Depending upon  the value of the parameter passed, the same number of spaces as the parameter  passed are generated.
 
 Let us check the same with the help of some examples.
 
- DECLARE @Student TABLE  
- (  
-    StudentIdint NOT NULL,  
-    FirstNamevarchar(20),  
-    LastNamevarchar(20),  
-    Marks int  
- )  
-   
- Insert Into @Student (StudentID,FirstName,LastName,Marks) Values (1,'John','Smith',200)  
- Insert Into @Student (StudentID,FirstName,LastName,Marks) Values (2,'Frank','Doe',400)  
-   
- SELECT RTRIM(FirstName) + SPACE(10) + LTRIM(LastName) as Name  
- FROM @Student  
 ![]()
 
 Using space function we have created space between the two concatenated values.  Passing the parameter a value of 10 gives 10 spaces between the two columns.
 
 This is how we can use Space function in SQL Server.