Dropping constraints  Which datatypes can I convert?

Chapter 8: Creating Databases and Tables

Modifying columns

To modify an existing column, use:

alter table table_name
     modify column_name datatype [null | not null]
     [null | not null]
     [, column_name...]

Where:

You can modify any number of columns in a single alter table statement.

For example, this command changes the datatype of the type column in the titles table from char(12) to varchar(20) and makes it nullable:

alter table titles
modify type varchar(20) null

WARNING! You may have objects (stored procedures, triggers, and so on) that depend on a column having a particular datatype. Before you modify a column, make sure that any objects that reference it can run successfully after the modification. Use sp_depends to determine a table’s dependent objects.





Copyright © 2005. Sybase Inc. All rights reserved. Which datatypes can I convert?

View this book as PDF