Hi !
I have the following situation:
I have a table in which I specify a given DB. The table of the DB is known. I need to select info from that DB and table from inside a stored procedure. Follow? Like this:
select * from @OtherDB.dbo.Table where Col = @Parameter
The problem is that I get an error (Incorrect syntax near '.') when I have the statement like this. How do I correct the @OtherDB part so that it will work dynamically??
Tnx!!
//adek
I have the following situation:
I have a table in which I specify a given DB. The table of the DB is known. I need to select info from that DB and table from inside a stored procedure. Follow? Like this:
select * from @OtherDB.dbo.Table where Col = @Parameter
The problem is that I get an error (Incorrect syntax near '.') when I have the statement like this. How do I correct the @OtherDB part so that it will work dynamically??
Tnx!!
//adek