Please start any new threads on our new 
    site at https://forums.sqlteam.com.  We've got lots of great SQL Server
    experts to answer whatever question you can come up with.
    
        | 
                
                    | 
                            
                                | Author | Topic |  
                                    | sqlbugPosting Yak  Master
 
 
                                        201 Posts | 
                                            
                                            |  Posted - 2013-04-05 : 11:55:19 
 |  
                                            | Hi,I've this table with a field specified as type varchar(2500). But when data is saved to the table - they are truncated to size 500. I double checked the saving part and there is nothing in the stored procedure or in the code that can cause this.So I'm puzzled what I am missing.Need help please. Thanks.Sqlbug |  |  
                                    | chadmatThe Chadinator
 
 
                                    1974 Posts | 
                                        
                                          |  Posted - 2013-04-05 : 12:00:37 
 |  
                                          | There is not much for us to go on here.  I guess we are taking your word for it that "...there is nothing in the stored procedure or in the code that can cause this..."But I suspect there actually is.-Chad |  
                                          |  |  |  
                                    | LampreyMaster Smack Fu Yak Hacker
 
 
                                    4614 Posts | 
                                        
                                          |  Posted - 2013-04-05 : 12:01:02 
 |  
                                          | Without any code to look at and your assurance that the code is good, I'd take a look at what is calling the stored procedure and see if anything is happening before the call. |  
                                          |  |  |  
                                    | sqlbugPosting Yak  Master
 
 
                                    201 Posts | 
                                        
                                          |  Posted - 2013-04-05 : 12:42:07 
 |  
                                          | Hi Chad and Lamprey - I believe I found the reason. That field length was increased to 2500 at some point and the stored procedures were updated to match that, but the dataset was not updated. As a result - the MaxLength property for that field in the dataset was still 500. So I updated the dataset.I haven't tested yet. If problem persists, I'll be back with more information.In the meantime - thanks for your offers to help.Appreciate it, see you again. |  
                                          |  |  |  
                                |  |  |  |