SQL 2005 Question

Posted on 2009-12-24
Last Modified: 2012-05-08
A lot of reports I de-bug have errors that come back similiar to this:

Msg 8152, Level 16, State 14, Line 2
String or binary data would be truncated.

The reports are using Temp tables and I know something is not large enough to capture the info to the result set.

What I was hoping for is a generic SQL that I can interchange the table and string length into to look at the tables to determine my culprit faster.

For Example:

I want to see what doctor name in my DoctorFacility table is over 60 VARCHAR characters.

SELECT df.listname where (characters > 60) ... something like that.
Question by:JeffSturgeon2002
    LVL 75

    Accepted Solution

    SELECT df.listname
    from df
    where len (df.listname ) > 60
    LVL 7

    Author Closing Comment


    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
    In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video discusses moving either the default database or any database to a new volume.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now