Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Alter table command problem
Message
De
11/09/2001 06:12:16
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
11/09/2001 04:06:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00555013
Message ID:
00555026
Vues:
18
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform