Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Primary Key Generation - SQL
Message
De
09/08/2001 14:34:21
 
 
À
08/08/2001 15:43:00
Chuck Berry
Copper State Bolt & Nut Co.
Phoenix, Arizona, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00541501
Message ID:
00541923
Vues:
12
>The Developer's Guide advises after upsizing to remove the defaults from the SQL tables that reference the NEWID() function. It doesn't suggest how to implement another way of getting a unique ID from the MM stored procedures.
>
>What would be the best solution to implement the SQL stored procedures for adding records to a SQL table?
>
>
>TIA
>
>Chuck Berry

I don't use MM either but here are a couple of thoughts:

1) What version of SQL are you using? If it's 2K, then you can create a UDF that calls the MM stored proc, and use that as a field default.

2) What is the field type of the PK? If it is a GUID then you could leave the NewID() call in the default. That is a native SQL function (starting with 7, I think) that genetes GUID values.

The other option is to call the MM key generator proc in an insert trigger.

Hope that helps!
Dan LeClair
www.cyberwombat.com
SET RANT ON - The Wombat Blog

Life isn’t a morality contest and purity makes a poor shield. - J. Peter Mulhern
Disclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform