Problem in general ...
I'tt tell You what I'm trying to do and why do I need to
determine the column's precision ... I'm writing an application
that MUST work on both: SqlServer and Visual Fox Pro as
an DataSource (maybe Oracle if will be needed). My client's
are Big (above 1000 peoples) as good as smal ones (les than <100)
Those secound ones doesn't commonly have any IT cell or any
support so any changes in DataBase structure has to be done from
my application. I must to connect to my DataSource , check it's
structure and do some changes if needed ... Columns in the data base
are created from text columns definition file with type conversions
shown in a table:
Types described in collumns definition file.Types like c# except text.
Columns are created in Sql server as follows: Columns are created in Vfp
server as follows:
If compatible with my older application. Without compatibility If
compatible with my older application. Bez zgodnosci
String
Char (x)*
Char (x)
Char (x)
Char (x)
Int
Decimal (x,0)*
Int
Numeric (x,0)
Int
Double
Decimal (x,y)
Decimal (x,y)
Numeric (x,y)
Numeric (x,y)
Bool
Decimal (1,0)
Decimal (1,0)
Numeric (1,0)
Decimal (1,0)
Text
Char (250)
Text
Char (250)
Memo
x,y - scale and precision
So to be sure that my DataSource is Ok i must to obtain
it's current structure (f.e. by sp_columns) and compare it with
my definition file ... The problem is that VFP equivalent of sp_table
(AFFIELDS()) is not working propelly (not supported?) by VFP
OLEDB provider... So I think I could compare definitions with
DataTable selected from DataSource including the diferences...
By the way ...
When Select command is executed in Database and Ado.net
fills DataTable columns in select are converted to only two types used
later in my application as follows:
Types described in collumns definition file.Types like c# except text.
Internal application c# type:
String
String
Int
Double
Double
Double
Bool
Double
Text
String
Sorry My English
Feel free to correct mistakes in my plan ...