Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Upsizer and uniqueidentifiers
Message
De
04/09/2013 21:23:03
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
VFPX/Sedna
Titre:
Upsizer and uniqueidentifiers
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01582231
Message ID:
01582231
Vues:
87
This may be something only Doug Hennig will know but :

I love the Sedna Upsizer. I have over 100 tables in a database that use guid(36) - i.e. char(36) nocptrans as keys. ( VFE, of course)

I know the format is correct as the string works fine in an insert statement in SSMS to a uniqueidentifier column

for field mapping the wizard sees the columns as C(36) on the VFP side but doesn't care about nocptrans. Fair enough.

uniqueidentifier is not an option on the dropdown. I thought I might get it on there by fiddling the typemap table to make uniqueidentifier one of the choices for character (in place of text)
but when I rebuild the app I get an operator/operand type mismatch ( which it is technically as only a very specific string would be seen by SQL as a uniqueidentifier.

This is a one off conversion program I need to write so I'd like to leverage the power of the upsizer.

I tried to use bulkxmlload as Doug shows on his website, but it doesn't like inserting c(36) no cptrans into uniqueidentifiers either.

If I let the upsizer to its thing, everything works great but all my pks and fks in over 100 tables are char(36) instead of uniqueidentifier.

Soooo.

My thought is to have upsizer generate the create table statements as shown below but intervene at some point to change all the char(36) to uniqueidentifier, then do not use bulk insert on the wizard choice. I don't know how to get that sql_uw.sqlscript to execute ( with connection etc) after the fact and then to use the insert logic of the upsizer.

OR

figure out a T-SQL script that will do an alter table on all the tables and change the data type of all char(36) columns

Any thoughts on this much appreciated. I know most VFP people have never used GUIDs in their apps so this may more a hack the upsizer question.
/* Create table 'account_debits' */
CREATE TABLE [account_debits] ([cid] char(36) NOT NULL , [cinmates_id] char(36) NULL , [yamount] money NOT NULL , [cpurchases_id] char(36) NULL , [ctype] char(15) NOT NULL , [ddate] datetime NULL , [mnotes] text NOT NULL , [ccheck_number] char(10) NOT NULL , [cuserid] char(10) NOT NULL , [cshiftlog_id] char(36) NULL , [cbank_checks_id] char(36) NULL , [cpayout_requests_id] char(36) NULL , [ycreditedamt] money NOT NULL , [cwithdrawal_number] char(8) NOT NULL , [dtxndatetm] datetime NULL , [limported] bit NOT NULL , [cexports_id] char(36) NULL , [ctransfer_batches_id] char(36) NULL , [cycreditedamt_exports_id] char(36) NULL , [tycreditedamt_txndatetm] datetime NULL , [cycreditedamt_userid] char(10) NOT NULL , [cycreditedamt_shiftlogid] char(36) NULL , [cbookings_id] char(36) NULL , [cacct_events_id] char(36) NULL , timestamp_column timestamp)

/* Index code */


Charles Hankey

Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy

Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.

-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin

Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform