Solved

Restricting the size of a column in SQL

Posted on 2011-03-14
2
299 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

738 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