What is the use of Space function and explain example?

 Posted by vishalneeraj-24503 on 1/29/2014 | Category: Sql Server Interview questions | Views: 1310 | Points: 40
Answer:

Space is an in-built Sql Server function which returns a string of the specified number of spaces.
Whatever the number we provide in space function,will generate space characters.In short we can say that,it is used for giving the spaces between characters.

For Example:
Select Space(5);

It will generate 5 space characters.

SELECT 'Vishal' + SPACE(1) + 'Neeraj';


Output:
Vishal Neeraj


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response