Sql to increase column size

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Locked
User avatar
BRobinsonS
Posts: 355
Joined: Sun Sep 25, 2005 9:00 pm
Location: Ontario, Canada
Contact:

Sql to increase column size

Post by BRobinsonS »

I have a field in a couple tables of ProvState String(2) .
I have a request from Australia that a user needs at least String(3).
I would like to alter the field/column size to String(5) for existing databases using SQL in the code.

What would be the correct syntax using Neobook and DBPro?
Brian Robinson
'When all else fails, try again!'
www.ComputerSoftwareSystems.com
User avatar
Gaev
Posts: 3782
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada
Contact:

Re: Sql to increase column size

Post by Gaev »

Brian:

Slightly different syntax depending on server brand ... details here ... http://www.1keydata.com/sql/alter-table ... olumn.html
Rasl
Posts: 138
Joined: Sat Apr 02, 2005 8:25 am
Location: Buenos Aires, Argentina

Re: Sql to increase column size

Post by Rasl »

dbpExecSQL "DATABASE" "[sql]" ""

[sql]
SQL Server / MS Access:

ALTER TABLE table_name ALTER COLUMN ProvState varchar(5);


My SQL / Oracle (prior version 10G):

ALTER TABLE table_name MODIFY COLUMN ProvState datatype;

Oracle 10G and later:

ALTER TABLE table_name MODIFY ProvState datatype;

salu2
User avatar
BRobinsonS
Posts: 355
Joined: Sun Sep 25, 2005 9:00 pm
Location: Ontario, Canada
Contact:

Re: Sql to increase column size

Post by BRobinsonS »

I am using the AccessDB of DBPro.
Brian Robinson
'When all else fails, try again!'
www.ComputerSoftwareSystems.com
User avatar
Gaev
Posts: 3782
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada
Contact:

Re: Sql to increase column size

Post by Gaev »

Brian:
I am using the AccessDB of DBPro.
As per ... https://msdn.microsoft.com/en-us/librar ... e.12).aspx ...

Code: Select all

ALTER TABLE {your Table Name here} ALTER COLUMN {your Field Name here} TEXT(5)
User avatar
BRobinsonS
Posts: 355
Joined: Sun Sep 25, 2005 9:00 pm
Location: Ontario, Canada
Contact:

Re: Sql to increase column size

Post by BRobinsonS »

Thank you.
It works.
Brian Robinson
'When all else fails, try again!'
www.ComputerSoftwareSystems.com
Locked