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 |  
                                    | rammohanPosting Yak  Master
 
 
                                        212 Posts | 
                                            
                                            |  Posted - 2010-02-05 : 03:07:41 
 |  
                                            | hi,i want to alter a column in sqlserver 6.5, i want to increase the length of column. follwing code throwing error :ALTER TABLE Trace ALTER COLUMN [Message] varchar(8000) ::in correct syntaxt near column.please show me a wayOne can never consent to creep,when one feels an impulse to soarRAMMOHAN |  |  
                                    | KristenTest
 
 
                                    22859 Posts | 
                                        
                                          |  Posted - 2010-02-05 : 04:03:51 
 |  
                                          | I think you have to rebuild the whole table to extend a column, don't you?Drop constaints and foreign keysCreate a new, temporary, table with desired changesReapply constraintsINSERT INTO TempTable SELECT * FROM OriginalTableDrop original tableRename TempTable to OriginalTableReapply PK and indexes and FKeysPersonally I would make the changes in Table Designer in a more recent version of SQL, script the change, and then apply the script to the old database. |  
                                          |  |  |  
                                |  |  |  |