Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alter Column

Status
Not open for further replies.

JeeEiych

IS-IT--Management
Aug 22, 2001
7
Hi guys.
I have a problem in altering a column. I run an SQL command in SQL v7 sp2. I used this line:
Alter Table MyTable
Alter Column MyField char(20)

I run this script in two databases from the SQL query analyzer. It responsed differently. On one database is working but on the other, it response a message
"Server: MSG 170, level 15, state 1, line 2
Line 2: incorrect syntax near column"

Both of them has the same structure and on the same machine, and MyField was a char(10)-field.

thanks.
 
Hello

Are you sure you're running the exact same script as you've typed above against both databases? Because the error message seems to imply that you might have simply mistyped something in one of them
The statement itself works fine for me.

hope this helps
LFCfan
 
I have experienced this tooo..
What I could say that the compatibility levels of both the
database

What you could do is bring the compatibility of both the databases to same level eg: 80 execute the comand and then convert the compatibilty back to the original

Well i dont know the exect syntax but check out in help
one of the levels support the COLUMN word in alter column
other does not..

dbcc cmptlevel ??? well i just cant recollect
but I am sure thats the issue


Regards
Nikhil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top