Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 Other Forums
 SQL Server 6.5 \ SQL Server 7.0
 how to alter column in 6.5?
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

212 Posts

Posted - 02/05/2010 :  03:07:41  Show Profile  Visit rammohan's Homepage  Send rammohan an AOL message  Reply with Quote

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


United Kingdom
22859 Posts

Posted - 02/05/2010 :  04:03:51  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000