SQL Archives - Digital Tool Factory blog SQL Archives - Digital Tool Factory blog

The 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


20
Oct 10


Written By Steve French

 




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