Solved

SQL needed to find character length for each record of a field

Posted on 2008-06-23
3
1,847 Views
Last Modified: 2008-06-23
Hi, I need to run a query that will tell the length of characters for each record; so:
fieldA = somedata
fieldB = somemoredata
Then the query would return:
fieldA = 8
fieldB = 12
Can anyone assist?
0
Comment
Question by:jimshock
3 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 300 total points
Comment Utility
select len(fieldA), len(fieldB) from yourtable
0
 
LVL 60

Expert Comment

by:chapmandew
Comment Utility
something like this...you'll need to do it for each field

select len(ltrim(rtrim(fieldname)))
from yourtablename
0
 

Author Comment

by:jimshock
Comment Utility
Thanks!!!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how the fundamental information of how to create a table.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now