Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 13th, 2007, 03:52 PM
Authorized User
 
Join Date: Jul 2006
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default T-SQl Extract

I am wanting to extract data from a column either by specifying the length of the data or when the data ends with ????

Thanks

Greg

 
Old March 13th, 2007, 04:56 PM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

You can use RIGHT and LEN methods to get the right most charecters and the total length of the string.

Regards
Ganesh
http://ganeshprof.blogspot.com
Find your solution here...
 
Old March 14th, 2007, 12:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

You can use SUBSTRING function of SQL. Also look for String functions in Books online to choose the one that fits your requirement the most.
Code:
Select Substring(col1, 1, 15) from Table_Name
Cheers

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to extract a spreadsheet ravee39 SQL Server 2005 1 April 23rd, 2007 09:20 AM
how to extract from a string fraijo SQL Server 2000 3 October 25th, 2006 09:55 PM
extract querystring marclena .NET Web Services 2 May 16th, 2005 06:20 AM
Extract Field Value maha Access 2 June 25th, 2003 12:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.