Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Server numeric data type conversion
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00833234
Message ID:
00833244
Vues:
32
This message has been marked as a message which has helped to the initial question of the thread.
Paul,

I'm not sure but I think VFP addes one position for sign and another for a '.'. Neither one requires extra space in SQL Server.

>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
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform