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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alter Column 1

Status
Not open for further replies.

NetworkGuy101

IS-IT--Management
Aug 13, 2002
482
US
I want to change the column type from NText to float(8)

Is this syntax correct? I am getting an error
Alter Table CKLST18WG Alter column ROW1 float(8)

Help is appreciated.

Thanks
 
Refer to BOL

The altered column cannot be:

A column with a text, image, ntext, or timestamp data type.
 
That should do it. If you are not sure, create an empty temporary table and test it. Here's the syntax from BOL:
ALTER TABLE table
{ [ ALTER COLUMN column_name
{ new_data_type [ ( precision [ , scale ] ) ]
[ COLLATE < collation_name > ]
[ NULL | NOT NULL ]
| {ADD | DROP } ROWGUIDCOL }
]

Good luck.
 
Sorry I am new to SQL so What is BOL? I tried my syntax and it said I cannot convert from because the field is NText. I also tried converting to NVARCHAR(50) and got the same message
 
BOL is the SQL Server Books On Line. This should get installed with sql server client, and is a vast source of information. Search for ALTER TABLE in the index - The reference specifically says you cannot alter the data type of an Ntext column, along with several other cases where you cannot use ALTER COLUMN.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top