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.

 All Forums
 Other Forums
 SQL Server 6.5 \ SQL Server 7.0
 how to alter column in 6.5?

Author  Topic 

rammohan
Posting 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 way

One can never consent to creep,when one feels an impulse to soar
RAMMOHAN

Kristen
Test

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 keys

Create a new, temporary, table with desired changes

Reapply constraints

INSERT INTO TempTable SELECT * FROM OriginalTable

Drop original table

Rename TempTable to OriginalTable

Reapply PK and indexes and FKeys

Personally 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.
Go to Top of Page
   

- Advertisement -