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

About the author

Steve French Steve is the President and lead developer of Digital Tool Factory and currently provides all technical development for DTF. Digital Tool Factory has provided behind the scenes technical muscle to the Atlanta design community since 2002.Google+ Profile

Tags:

 

Written By Steve French

 

Leave a Reply





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