Amferreira
Programmer
VFP - How can I check the nullability of a sqlserver Field ?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
lnConn = SQLCONNECT("MyODBCDataSource")
lcCmd = "EXEC sp_help 'Customers'"
SQLEXEC(lnConn, lcCmd, "csrHelp")
SELECT Nullable FROM csrHelp1 ;
WHERE ALLTRIM(LOWER(Column_name)) == "cust_name" ;
INTO ARRAY laTemp
IF ALLTRIM(LOWER(laTemp(1))) == "yes"
* Field is nullable
ELSE
* It's not nullable
ENDIF
lnConn = SQLCONNECT("MyODBCDataSource") && or use SQLStringConnect, you know best yourself how you connect
SQLCOLUMNS(lnConn, 'Customers', 'NATIVE', 'curServerColumns')
Or use SQLColumns()