Solved

Restricting the size of a column in SQL

Posted on 2011-03-14
2
300 Views
Last Modified: 2012-05-11
Hi,

When I do a normal query the disply shows the default size of the column , can I restrct the size of the column to less than the default for dislay alone .
0
Comment
Question by:FranklinRaj22
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 17

Expert Comment

by:Daniel Reynolds
ID: 35132700
If it is only for display, change the SELECT of the data to only grab say the first 30 characters instead of all characters.

something like...

SELECT LEFT(myColumn,30) AS [myCoilumn]
  FROM myTable
0
 
LVL 17

Accepted Solution

by:
Daniel Reynolds earned 500 total points
ID: 35132709
Sorry, got mixed up here.

If you are using sql you would use
SELECT SUBSTRING(myColumn, 0, 30)
  FROM myTable

                                                           
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

705 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