Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameterized stored procedure question
Message
From
27/11/2002 12:25:31
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Parameterized stored procedure question
Miscellaneous
Thread ID:
00727639
Message ID:
00727639
Views:
28
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
Next
Reply
Map
View

Click here to load this message in the networking platform