Information générale
Titre:
Macro substitute equivalent in SQLServer 6.5
Is there a way to do equivalent of macro substitution in SQL-Server
I have a stored procedure for a specific database to retrieve 101 records from a table (50 prior to given key, key record, 50 after the given key value)
Since you can't use the command
USE (other database name)
within a stored procedure, I need the ability to tell it which database to get the data out of, and also for create cursor/fetch.
ex:
ClientDatabase_A - CustomerTable
ClientDatabase_B - CustomerTable
..
..
ClientDatabase_C - CustomerTable
Also, depending on the parameters passed in (which I already have under control), I may need to look at a different table and fields
for selection. The principle can still apply but for "inventory items" instead of the CustomerTable..
Any help would be greatly appreciated,
TIA
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement