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
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Alter Table Alter Column problem

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-04-09 : 13:05:11
Paul writes "I am trying to run the following script:

Alter table <table Name>
alter column <column name> char(10) not null

This works on 4 different systems we have tried in house but on one particular site I get the error message:

Server: Msg 170, Level 15, State 1, Line 4
Line 4: Incorrect syntax near 'column'.

Both systems are on SQL 7 service pack 3.

Is there any known reason why this would work on one system and not the other. (Both servers are NT4, the one that works SP5 and the one that doesn't SP6)"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-04-09 : 13:33:08
Could the one it doesn't work on be set to SQL 6.5 compatibility mode? ALTER COLUMN doesn't exist in 6.5 and earlier. You can check the compatibility level by running sp_dbcmptlevel. BEFORE YOU CHANGE THE COMPATIBILITY LEVEL, read Books Online thoroughly about it, so that you can see if there are any potential side effects you don't want.

Go to Top of Page
   

- Advertisement -