String Concatenation and Scope Resolution Operator in SQL Server 2008 R2

Target Audience: Beginners

SQL Server 2008 R2 comes with String Concatenation Operator.

String Concatenation operator is denoted by symbol plus ‘+’.

clip_image002

Output we will get,

clip_image003

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

clip_image005

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.

clip_image007

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.

clip_image009

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

Output

clip_image010

Dhananjay Kumar is Developer, Blogger , Speaker, Learner , Mindcracker & Microsoft MVP.

Posted in SQL Server
One comment on “String Concatenation and Scope Resolution Operator in SQL Server 2008 R2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

  • after 2 sixes of Sami .. I say LOL -> Virat KOHLI ... happy to see Kohli the ILL ATTITUDE MAN LOOSING .. 8 hours ago
  • It does not matter from where are you coming ? only does matter where are you going ? #djsays 8 hours ago
  • With people who participated in WCF day .. Great hosting by @CsharpCorner amd great leadership of @mcbkruse http://t.co/HkHjCdveJC 9 hours ago
  • RT @petekrueger: I've been using @Icenium. I would definitely recommend checking it out if you're tackling cross-platform mobile: http://t.… 9 hours ago
  • मुझे ग़म है की मैंने जिंदगी में कुछ नहीं पाया , ये ग़म दिल से निकल जाये अगर तुम मिलने आ जाओ 10 hours ago
Categories
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my current or previous employer's view in anyway. © Copyright 2013
Follow

Get every new post delivered to your Inbox.

Join 2,123 other followers

%d bloggers like this: