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?
Sql to increase column size
Moderator: Neosoft Support
- BRobinsonS
- Posts: 355
- Joined: Sun Sep 25, 2005 9:00 pm
- Location: Ontario, Canada
- Contact:
Re: Sql to increase column size
Brian:
Slightly different syntax depending on server brand ... details here ... http://www.1keydata.com/sql/alter-table ... olumn.html
Slightly different syntax depending on server brand ... details here ... http://www.1keydata.com/sql/alter-table ... olumn.html
Re: Sql to increase column size
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
[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
- BRobinsonS
- Posts: 355
- Joined: Sun Sep 25, 2005 9:00 pm
- Location: Ontario, Canada
- Contact:
Re: Sql to increase column size
I am using the AccessDB of DBPro.
Re: Sql to increase column size
Brian:
As per ... https://msdn.microsoft.com/en-us/librar ... e.12).aspx ...I am using the AccessDB of DBPro.
Code: Select all
ALTER TABLE {your Table Name here} ALTER COLUMN {your Field Name here} TEXT(5)
- BRobinsonS
- Posts: 355
- Joined: Sun Sep 25, 2005 9:00 pm
- Location: Ontario, Canada
- Contact:
Re: Sql to increase column size
Thank you.
It works.
It works.