Margary
Computer
- Jul 20, 2005
- 1
Hi
A question that got my mind wandering...
Let’s say I needed to change a .proc file. In the .proc file, I’m accessing a certain db. Let’s say if I didn’t know the name of the db during runtime (because the db name is dependent on a env variable) , I was thinking of creating a variable to store the name of the db (which is passed in through a perl wrapper script that calls the .proc).
Let’s say I have the following…
declare @my_db varchar(10)
select @my_db=”<whatever value is passed in through the perl script>”
Can I do the query below? If not, can you suggest a way on how I can do it ?
select * from @my_db..<name of the table>
Thanks,
Margary
A question that got my mind wandering...
Let’s say I needed to change a .proc file. In the .proc file, I’m accessing a certain db. Let’s say if I didn’t know the name of the db during runtime (because the db name is dependent on a env variable) , I was thinking of creating a variable to store the name of the db (which is passed in through a perl wrapper script that calls the .proc).
Let’s say I have the following…
declare @my_db varchar(10)
select @my_db=”<whatever value is passed in through the perl script>”
Can I do the query below? If not, can you suggest a way on how I can do it ?
select * from @my_db..<name of the table>
Thanks,
Margary