How to fix lengthy database records in SQL Server - Digital Tool Factory blog How to fix lengthy database records in SQL Server - Digital Tool Factory blog

How to fix lengthy database records in SQL Server

The Problem: You wish to truncate database records, but you can’t remember how.  At first, Google is no help.

The Cause: You are using the term “Truncate” which is usually used to truncate a table, when all you really want to do is chop characters off of overly long database records.

The Solution: Use the “Left” syntax, as in

Select  LEFT(FullBizName, 45) AS FullBizNameShort From TableName

and that’s it!

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog

Tags:

 

Written By Steve French

 

Leave a Reply

Your email address will not be published. Required fields are marked *






Copyright 2011 Digital Tool Factory. All Rights Reserved. Powered by raw technical talent. And in this case, WordPress.