String Concatenation and Scope Resolution Operator in SQL Server 2008

No.of Views2164
Bookmarked0 times
Downloads 
Votes0
By  Dhananjay Kumar   On  27 Mar 2011 07:03:56
Tag : Sql Servers , Database Administrator
In this article,i will show how to String Concatenation and Scope Resolution Operator in SQL Server 2008.
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Introduction

In this article,i will show how to String Concatenation and Scope Resolution Operator in SQL Server 2008.

SQL Server 2008 R2 comes with String Concatenation Operator.String Concatenation operator is denoted by symbol plus ‘+’. 

Image Loading

Output we will get,

Image Loading

String concatenation operator can concatenate string with real time data of any type also.

Image Loading

In above query ,  firstName and lastName column is being concatenated using string concatenation operator of SQL Server 2008 R2.  In above query we are also concatenating HireDate . Since HireDate is of type DateTime , we need to convert that first before concatenating.

Image Loading

SQL Server 2008 R2 comes with Scope Resolution Operator.
Scope Resolution operator is denoted by symbol ‘::’
It is used to access static members of compound data type.

Image Loading

In above query hierarchyId is a compound data type.  And we are accessing static function GetRoot() of this type.

Output 

Image Loading

That's all.thank you for reading.

 
Sign Up to vote for this article
 
About Author
 
Dhananjay Kumar
Occupation-Software Engineer
Company-Infosys Technolgies,Pune
Member Type-Gold
Location-India
Joined date-20 Jul 2009
Home Page-http://dhananjaykumar.net/
Blog Page-http://dhananjaykumar.net/
Dhananjay Kumar is Microsoft MVP on connected system. He blogs at http://dhananjaykumar.net/ . You can follow him http://twitter.com/debugmode_/ and reach him at dhananjay.25july@gmail.com
 
 
Other popularSectionarticles
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top
</