Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL server padding a 10 character field with spaces
Message
De
16/01/2002 09:56:41
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
20/11/2000 16:46:36
Stephen Hunt
Admit Computer Services Inc.
Farmingdale, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00443849
Message ID:
00605364
Vues:
8
>I created a view which is based on ODBC setting for an SQL server table. IF VFP when I set a 10 character field a value
>of "ABC" in a new record, after I update the SQL table, the field is saved to the SQL server
>table as "ABC" padded to the right with 7 spaces. Is there any way either through a VFP command or ODBC setting
>or possibly an SQL server setting to prevent this from happening ?
>
>Thanks for your help
>Stephen J. Hunt

Stephen,
On SQL server side datatype should be varchar and 'ansi_padding on' when table created (default and recommended). In that case SQL server doesn't trim c(10) sent by VFP. However SQL varchar maps to VFP memo more closely rather than char type. If you map it to memo type then SQL server stores w/o trailing space.
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