Red Gate forums :: View topic - Warning: column will be truncated
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Compare 10
SQL Compare 10 forum

Warning: column will be truncated

Search in SQL Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
wayne.mcdaniel



Joined: 25 Oct 2013
Posts: 1
Location: Jonesboro, Arkansas

PostPosted: Fri Oct 25, 2013 1:23 am    Post subject: Warning: column will be truncated Reply with quote

I'm using SQL Compare 9.0.0.79.

I'm trying to change a column for a memo field from Varchar(8000) to Varchar(MAX). SQL compare generates the script, but gives me a warning: "The column [Notes] on table [table] is being truncated. There may be loss of data."

I did some testing, and this doesn't seem to be the case, but it makes me nervous. Is there any way I lose data going from varchar(8000) to varchar(MAX)??


When I make my upgrade scripts, I always make the rollback script by reversing the comparison. The rollback version - changing from Varchar(MAX) to varchar(8000) gives me no warnings. I'm pretty sure that could lead to data loss - why no warning here?


I found this old post with a similar issue http://www.red-gate.com/messageboard/viewtopic.php?t=6051

It's not suggesting or offering to drop and recreate the table for me, going in either direction. That post suggests the warning was fixed in 6.2 or 7....I wanted to report I'm still getting it in 9. Sad
Back to top
View user's profile Send private message
eddie davis



Joined: 14 Jun 2006
Posts: 924
Location: Red Gate Software

PostPosted: Mon Oct 28, 2013 5:23 pm    Post subject: Reply with quote

Hi Wayne

Thank you for you forum post and sorry that you have encountered a problem.

I was able to reproduce the problem using SQL Compare V10.4 and can confirm that the two reported problems are bugs in our software.

In my experience, the data type Varchar(MAX) is used when the number of characters exceeds 8000 characters.

To answer your first question:
Quote:

I did some testing, and this doesn't seem to be the case, but it makes me nervous. Is there any way I lose data going from varchar(8000) to varchar(MAX)??


In theory, you should not lose any data. However it is always good practise to backup the target database before deploying any changes to it.

To answer your second question:
Quote:

When I make my upgrade scripts, I always make the rollback script by reversing the comparison. The rollback version - changing from Varchar(MAX) to varchar(8000) gives me no warnings. I'm pretty sure that could lead to data loss - why no warning here?


Yes the data truncation warning should appear as you are correct, moving from Varchar(MAX) to Varchar(8000) could result in a loss of if the data string exceeds 8000 characters before deploying the change.

I suspect that both the reported problems are related and I will need to submit a Bug Report for the SQL Compare Development team to consider. I will provide a further update with the Bug Report Reference Number once I have created and submitted the Bug Report.

Thank you for bringing this issue to our attention.

Many Thanks
Eddie
_________________
Eddie Davis
Technical Support Engineer
Red Gate Software Ltd
E-mail: support@red-gate.com
Back to top
View user's profile Send private message Send e-mail
eddie davis



Joined: 14 Jun 2006
Posts: 924
Location: Red Gate Software

PostPosted: Mon Oct 28, 2013 5:45 pm    Post subject: Reply with quote

Bug Report now submitted, the reference is SC-6610. A similar problem was reported back in 2007 in the V6.1 which was fixed in V6.2.

Please accept my apologies that this bug has reappeared.

I will update this post when I have further information and details of a version of SQL Compare that fixes this issue.

Many Thanks
Eddie
_________________
Eddie Davis
Technical Support Engineer
Red Gate Software Ltd
E-mail: support@red-gate.com
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group