Showing posts with label varchar. Show all posts
Showing posts with label varchar. Show all posts

Tuesday, May 13, 2014

Maximum Column Content Lengths

Josh,

So you are working on loading data into a table from another table and you're getting truncation errors.  To keep the destination table as small as possible for speed, you need to find out which column is causing the truncation error and how much you need to increase the destination columns size.

Let's use the handy SYS schema to help us out...

Friday, June 22, 2012

MSSQL Character Value Rank

I recently ran into a scenario where a calculation was needed between an INTEGER and a VARCHAR field, with the issue being the VARCHAR field might contain values that could not be converted into an INTEGER type.  To exclude the values that contained text, I thought about adding to the WHERE clause only records with the field in question less than a character value.  But I ended up settling on a solution found on Stack Overflow here, as it works in more scenarios.

I was still curious as to the Character Value rank and after a search for a listing of Characters and their SQL ranking came up empty, I decided to create one with the code below.