Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Server numeric data type conversion
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
SQL Server numeric data type conversion
Divers
Thread ID:
00833234
Message ID:
00833234
Vues:
51
All:

Can someone tell me why the precision of a SQL Server numeric/decimal data type will always be two larger in a SPT results cursor in VFP?

For example going to the SQL Server pubs!discounts table:
LOCAL hConn, cConnectStr, nResult

hConn = 0
cConnectStr	= "DRIVER=SQL SERVER;SERVER=(local);UID=SA;PWD=;DATABASE=pubs"

hConn = SQLSTRINGCONNECT(m.cConnectStr)

IF hConn > 0
	nResult = SQLEXEC(m.hConn,"SELECT * FROM discounts")
	IF nResult > 0
		CLEAR
		DISPLAY STRU
	ENDIF 
	=SQLDISCONNECT(hConn)
ELSE
	= MESSAGEBOX("Connect Failed!")
ENDIF
The DISCOUNT field is defined as precision = 4 and scale = 2 in SQL Server. However, in the sqlresults cursor the DISCOUNT field has width = 6 and dec = 2.

--Paul
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform