Solved

Varchar(500)

Posted on 2014-10-20
6
15 Views
Last Modified: 2016-06-15
Dear Experts,

Please advise me.

Basically, this is a registration form. My Developer has set varchar(500) on the text field.
However, recently we realised that the number of character is more then 500. Hence, is there any way that i can retrieve the "DROP" data/packets ?

Currently, the data is store in Mysql which happens to be on the CPanel...
0
Comment
Question by:sky guo
6 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 250 total points
Comment Utility
>is there any way that i can retrieve the "DROP" data/packets ?
Explain what you mean by "DROP" data/packets.

If rows were instered that had a value in this column greater than 500, then the data was likely truncated at the 500th character, and there is no way to retrieve the 501st character onwards that was truncated.

btw if whatever code that INSERTS data has a SET ANSI_WARNINGS OFF line before it, then any truncation will happen without throwing a message/error, meaning you'd never know when this happens.  Setting SET ANSI_WARNINGS ON would throw the error.   Best practice is to leave it on to insure that all characters are inserted, and give the developer notice if the column is not big enough to handle source data.

>Basically, this is a registration form. My Developer has set varchar(500) on the text field.
I'd question how this data is being stored, but that's an issue for another question.
0
 

Author Comment

by:sky guo
Comment Utility
So for this case,

are we able to retrieve the files from innodb? or myisam?
0
 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 total points
Comment Utility
No, if the data was truncated when it was inserted, it is already lost.  You would need to go back to the original data set and recreate the tables with a longer VARCHAR() value.
0
 
LVL 65

Expert Comment

by:Jim Horn
Comment Utility
Just to keep the question moving along, please show us the T-SQL code / SSIS package screenshot that inserts data into this column.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
I suspect the author has inadvertently included the MS SQL Server topic area.  Since the question does not appear to have anything to do with SQL Server it probably should be dropped.
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

Creating and Managing Databases with phpMyAdmin in cPanel.
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

762 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

6 Experts available now in Live!

Get 1:1 Help Now