Monday, March 19, 2012

Alter table alter column in MSACCESS. How can I do it for a decimal field?

Hi people,

I?m trying to alter a integer field to a decimal(12,4) field in MSACCESS 2K.

Example:
table : item_nota_fiscal_forn_setor_publico
field : qtd_mercadoria integer NOT NULL

ALTER TABLE item_nota_fiscal_forn_setor_publico
ALTER COLUMN qtd_mercadoria decimal(12,4) NOT NULL

But, It doesn't work. A sintax error rises.

I need to change that field in a Visual Basic aplication, dinamically.

How can I do it? How can I create a decimal(12,4) field via script in MSACCESS?

Thanks,

Euler Almeida

--
Message posted via http://www.sqlmonster.comEuler Almeida via SQLMonster.com (forum@.SQLMonster.com) writes:
> I?m trying to alter a integer field to a decimal(12,4) field in MSACCESS
> 2K.
> Example:
> table : item_nota_fiscal_forn_setor_publico
> field : qtd_mercadoria integer NOT NULL
> ALTER TABLE item_nota_fiscal_forn_setor_publico
> ALTER COLUMN qtd_mercadoria decimal(12,4) NOT NULL
> But, It doesn't work. A sintax error rises.

I didn't not get any syntax error. Then again, I tried this on SQL Server,
since SQL Server is the focus for this newsgroup.

If you are working with an Access database, you are better of in an
Access newsgroup like comp.databases.ms-access.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

No comments:

Post a Comment