|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Alter field type problem
I need to alter a filed of type VARCHAR(3000) to VARCHAR (100)
ALTER TABLE PREGLED ALTER COLUMN NOMER TYPE VARCHAR(100); - is returning "Unsuccessful metadata update. New size specified for column NOMER must be at least 3000 characters." Is it possible? Greets. |
|
#2
|
|||
|
|||
|
No, it isn't. You cannot make a field smaller than it's original size.
Make sure the field has no dependencies (eg: indices, constraints, stored procedures) and then do the following: - create a new field with the new size (alter table mytable add newfield varchar(100) ) - update mytable set newfield = oldfield - drop the old field - rename the newfield to the oldfield name Martijn Tonies Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle & MS SQL Server Upscene Productions http://www.upscene.com My thoughts: http://blog.upscene.com/martijn/ Database development questions? Check the forum! http://www.databasedevelopmentforum.com
__________________
Martijn Tonies Database Workbench: developer IDE for Firebird, MySQL, InterBase, MSSQL Server and Oracle Upscene Productions http://www.upscene.com |
|
#3
|
|||
|
|||
|
It worked. Thanks!
Greets. |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > Alter field type problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|