Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parameterized stored procedure question
Message
De
27/11/2002 12:25:31
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
Parameterized stored procedure question
Divers
Thread ID:
00727639
Message ID:
00727639
Vues:
29
Hi,

I need a family of rules that practically beg for a generalized stored procedure with parameters, but I don't know how to do it.

The database contains data for several schools and each school has data for several years. The rules are required to make sure, for example, that a student registered in one school and year is not accidentally placed in a course for a different school or year.

Let's call one procedure (a function really) IsSameSchool with four parameters: Name of table1, Value of PK for table1, Name of table2 and Value of PK for table2. The function already knows the name of the field that contains the school's FK. Let the function figure out which is the PK of each table. I think this requires the equivalent of a macro, and I don't know whether T-SQL even allows that.

A related function might be GetSchool(Name of table, value of PK), but I don't know how to write that one either.

Any suggestions?

TIA,

Alex
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform