General information
Title:
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only