A View that is Odd

  • Hello Everyone

    I hope that you are having a very nice day. To some, it is already friday, the weekend is closer for you.

    I am selecting data from a View that is on another SQL server. Not any real big ordeal there. But I think the data behind the View is coming from DB2 or Oracle. There is a column named "Description" in the View and the data type is Varchar(60). Pretty normal. Yesterday I discovered after the SSIS package failed with a data truncation error, that there is data in that column that is more than the 60 character length. Some up to 253 characters in length. How can this be when the length of the column is only 60?

    Thank you in advance for your comments, suggestions and time

    Andrew SQLDBA

  • AndrewSQLDBA (6/19/2014)


    Hello Everyone

    I hope that you are having a very nice day. To some, it is already friday, the weekend is closer for you.

    I am selecting data from a View that is on another SQL server. Not any real big ordeal there. But I think the data behind the View is coming from DB2 or Oracle. There is a column named "Description" in the View and the data type is Varchar(60). Pretty normal. Yesterday I discovered after the SSIS package failed with a data truncation error, that there is data in that column that is more than the 60 character length. Some up to 253 characters in length. How can this be when the length of the column is only 60?

    Thank you in advance for your comments, suggestions and time

    Andrew SQLDBA

    Quick questions, what is the output of sp_help 'view_name'? Is the view schema bound? If not, do the sp_help, then sp_refreshview [ @viewname = ] 'viewname' and then sp_help again and compare the results.

    😎

  • Thank You

    Seems that is exactly what has happened. Someone changed the underlying table(s) that makes the View. I forgot about sp_refeshview.

    Thanks again, and happy friday

    Andrew SQLDBA

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply