Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alter table command problem
Message
From
11/09/2001 06:12:16
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
11/09/2001 04:06:10
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00555013
Message ID:
00555026
Views:
17
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform