C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Substring Function in Sql Server


Posted Date: 18 Jun 2008    Resource Type: Code Snippets    Category: String Manipulations

Posted By: Kapil Dhawan       Member Level: Gold
Rating:     Points: 2



Substring function, as the name suggests, is used to get a sub-string from a string. A sub-string is some part of a string. Mostly, when talking about sub-strings, we mean non-empty sub-strings.

Substring is an important string manpulation function and is invariably a part of any programming environment.

General syntax for obtaining a sub-string is


substring(string, startingindex, length)


A sample code for substring in T-SQL is :


select substring(custName,1,5) from tab_Customer


1 is starting location and 5 is the length of the substring to be obtained. So we are trying to obtain a substring of first 5 letters of all customer names




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Susbtring function  .  Substring funciton in sql  .  Substring fuction in T-SQL  .  String manipulation function  .  Obtaining a substring  .  Getting a substring  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Using rope - a STL container
Previous Resource: string type in C#.NET
Return to Discussion Resource Index
Post New Resource
Category: String Manipulations


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

accuconference

Contact Us    Privacy Policy    Terms Of Use