SQLServerCentral - www.sqlservercentral.com

A community of more than 1,600,000 database professionals and growing

Featured Contents

The Voice of the DBA

String or binary data would be truncated

Microsoft, please fix this. This issue is still out there, and once again, it's the top voted on item for SQL Server. Everytime I see this:

Msg 8152, Level 16, State 13, Line 1
String or binary data would be truncated.

I'm annoyed, and I'm not alone. If you've had to load data into SQL Server, and you've every encountered this error, you've probably been frustrated. In fact, when you get this particular error, you might wonder what to do.

Many of us find this error to be a problem because we don't know where the error is located. In fact, we often end up jumping through hoops to somehow track down the offending row. We might scan through our input file. Or we might build a parallel process to load the data into a series of MAX columns and then use T-SQL to search out the data, change it, and then export it again for us in our ETL process. Or we might throw up our hands in frustration and go for a walk.

SQL Server developers, if you feel any of these things, go vote for this item.

When there is a mismatch between our input data and the schema, there is a lot of friction to getting work done. While DBAs might be willing to track down the invalid rows, developers hate it and business people often get confused. This one reason why developers dislike relational schemas and look for easier data stores, like NoSQL databases. Trying to figure out that there's one name in a list of 1000 that's got 31 characters and doesn't fit in a 30 character field is a pain for anyone..

I have no idea of the effort to fix this, but this isn't a syntactical sugar item. Microsoft, this is a piece of work that can be extremely helpful. Pick a method to solve thisand get to work. Ignore the error rows and output them, let us redirect them to another table, or some up with some other solution. Make something simple that works, but please, just fix this.

It should be embarassing to you that this is still a issue that is reported and voted on in SQL Server.

Steve Jones from SQLServerCentral.com

Join the debate, and respond to today's editorial on the forums


The Voice of the DBA Podcast

Listen to the MP3 Audio ( 2.8MB) podcast or subscribe to the feed at iTunes and Libsyn. feed

The Voice of the DBA podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music.

ADVERTISEMENT
SQL Compare

The industry standard for comparing and deploying SQL Server database schemas

Trusted by 71% of Fortune 100 companies, SQL Compare is the fastest way to compare changes, and create and deploy error-free scripts in minutes. Plus you can easily find and fix errors caused by database differences. Download your free trial

Database DevOps

Database DevOps Demo Webinar

Learn how to automate your database deployments alongside your app code in this free demo webinar. Register now

Featured Contents

 

The OUTPUT Clause for INSERT and DELETE Statements

Amarendra Reddy Thummeti from SQLServerCentral.com

In this article, I will provide a set of examples to show case the use of OUTPUT clause for INSERT and DELETE statements. More »


 

Calculating MTD, QTD, YTD, Running and Cumulative Total in Power BI

Additional Articles from MSSQLTips.com

In this tip, you will be walked through a method to calculate MTD, QTD, YTD and running total in Power BI. This method is useful in stock calculations and balance sheet calculations. More »


 

Introduction to T-SQL Window Functions

Additional Articles from SimpleTalk

T-SQL window functions were introduced in 2005 with more functionality added in 2012. Many database professionals are not aware of these useful functions. In this article, Kathi Kellenberger provides a quick overview of just what a window function is as well as examples of each type of function. More »


 

From the SQLServerCentral Blogs - Query Store Usage and Adaptive Plan Tuning Usage

taboggiano@gmail.com from SQLServerCentral Blogs

Recently, there are have been a few articles about the lack of adoption of Query Store. Note the following: Brent Ozar... More »


 

From the SQLServerCentral Blogs - Replication Max Text Length

SQLEspresso from SQLServerCentral Blogs

Ever seen the below error? Until this week I hadn’t. So, I figured I’d take a little time and introduce... More »

Question of the Day

Today's Question (by Steve Jones):

I have a Windows host running SQL Server 2017. I want to log ship my Sales database to another instance for HA and DR purposes. What are my options for the second instance? Choose 3.

Think you know the answer? Click here, and find out if you are right.


We keep track of your score to give you bragging rights against your peers.
This question is worth 1 point in this category: Log Shipping.

We'd love to give you credit for your own question and answer.
To submit a QOTD, simply log in to the Contribution Center.

ADVERTISEMENT

XML and JSON Recipes for SQL Server: A Problem-Solution Approach

Quickly find solutions to dozens of common problems encountered while using XML and JSON features that are built into SQL Server. Content is presented in the popular problem-solution format. Look up the problem that you want to solve. Read the solution. Apply the solution directly in your own code. Problem solved! Get your copy from Amazon today.

Yesterday's Question of the Day

Yesterday's Question (by Steve Jones):

What's the default file encoding for Python 3 files?

Answer: UTF-8

Explanation:

The default encoding for files in Python is UTF-8.

Ref: Unicode HOWTO - click here


» Discuss this question and answer on the forums

Database Pros Who Need Your Help

Here's a few of the new posts today on the forums. To see more, visit the forums.

SQL Server 2017 : SQL Server 2017 - Administration

How to delete physical file associated with File stream - Hi How to delete physical file associated with File stream. ie: we are using file stream for storing scanned images. image details...


SQL Server 2016 : SQL Server 2016 - Administration

TempDB - Hello.  i have a doubt about the file size and the autogrowth. I read that is good to initializate the files with...

Mirgrating SSRS 2005 to SSRS 2016 - Greetings and Salutations! I was just wondering if anyone has had the distinct pleasure of Migrating SSRS reports from 2005 to...


SQL Server 2016 : SQL Server 2016 - Development and T-SQL

Unable to Import Excel 2016 into sql 2016 db using Import Wizard - Goal is to have one sql table for the 2016 excel file source. Am willing to try anything just to...


SQL Server 2014 : Administration - SQL Server 2014

Dedicated tempdb drive displays much more disk space usage than the actual size of the tempdb.mdf/ldf files - I need to ask a question referencing how SQL 2014 deals with the tempdb files and disk usage.   Our SQL Server...

Gap data for attendance - Hi all, Thanks in advance for any help. I have been asked to produce a CSV which shows current session bookings but...


SQL Server 2014 : Development - SQL Server 2014

SSIS data truncation. - I have a csv file which I am processing through SSIS. But there are companies in the list which have...


SQL Server 2012 : SQL 2012 - General

CDC Agent Job fills up the Agent Jobs History - We have implemented CDC on one of our databases. We now find that the job history for the CDC capture...


SQL Server 2012 : SQL Server 2012 - T-SQL

Automating activity logging - Hi: So I found this great script  here on SQL Server Central that allows me to query my database to see ...

Compression - Hi All, If I enable PAGE COMPRESSION on an empty table, when I insert the data (using INSERT INTO command), does...

Help in writing query for update - Can some one please help in writing query. My requirement is I am having 2 columns where I want to load...

Please help - complete missing data with latest recorded - Hi there, I have been stuck on this for days and I need submitting this report in the next two days. This...


SQL Server 2008 : T-SQL (SS2K8)

Find Receipt entry against invoice - Hello experts I need some help regarding SQL query, I have a table to save invoices and receipts against invoices. need a query...


Programming : General

Odd results from WHERE in SQL - So I have a bit of VBA put together to manage the output of data based on selections made from...


Data Warehousing : Integration Services

Is combining multiple SQL Server Database and Integration Services projects in one master solution a bad idea? - tl;dr:  How do you organize your multiple SSDT projects that comprise a single solution? I've got a DW with these logical...

Granting SSIS access to developers - I'm trying to give access to our developers to SQL 2012 Integration Services without granting server admin, following the procedure...


SQL Server 2005 : Administering

How to change SQL Server Collation - Hello, this message was previously posted in the General Discussion and got no answer. Perhaps this is the correct place... I...


SQL Server 2005 : SQL Server Newbies

SUM of 2 columns in 2 tables THIS IS REALLY SIMPLE - I want to SUM a column in one table and SUM a column of another table and have the two...


SQL Server 7,2000 : T-SQL

T-SQL statement to return SQL Job Last Run Date - Hi, Is there anyway that we can retrieve the Last Run date of a SQL Job using T-SQL. Thanks

Sort column without ORDER BY - Is there any method to sort a column(numeric) without using ORDER BY clause.

This email has been sent to newsletter@newslettercollector.com. To be removed from this list, please click here.
If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com.
This newsletter was sent to you because you signed up at SQLServerCentral.com.
Feel free to forward this to any colleagues that you think might be interested.
If you have received this email from a colleague, you can register to receive it here.
This transmission is ©2018 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
Contact: webmaster@sqlservercentral.com