>Dear all,
>
>I just upsized my tables into SQL Server and I would like to change a field into allow null value. I'm using this command to do that "=SQLEXEC(mConn, "alter table table1 alter column fieldA NULL"). It didn't change the field and return -1. How I use the VFP statment to change the field type on SQL server? Thank you for your help ....
>
>Best Regards,
>
>Justy Chow
Justy,
Command needs datatype and precision too. But specifying that too doesn't mean you could do it. There are a series of situations SQL server wouldn't let to altering of a column (constraints,indexes,rowguidcol,some datatypes etc).
OTOH allowing NULLs is not a suggested thing, you should do it if you're really sure you want to do it.
If SQL server doesn't let it you can check why by aerror() :
if SQLExec(...) < 0
WhyFailed()
endif
function WhyFailed
aerror(arrWhy)
for ix=1 to 7
? arrWhy[ix]
endfor
Cetin