Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 309
  • Last Modified:

Restricting the size of a column in SQL

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
FranklinRaj22
Asked:
FranklinRaj22
  • 2
1 Solution
 
Daniel ReynoldsSoftware Applications Developer / IntegratorCommented:
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
 
Daniel ReynoldsSoftware Applications Developer / IntegratorCommented:
Sorry, got mixed up here.

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

                                                           
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now