Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2003-05-16 : 09:42:04
|
| ashou writes "Hi Gurus,I like to pass a db name as a parameter in the stored procedure as:create proc test@dbname varchar(20) asdeclare @sql varchar(255)set @sql = 'select * from ' + @dbname + '..tablename'exec(@sql)the problem is that the server can't recognize the ..even I do the code like:set @sql = 'select * from dbname..tablename'which gives me the same error: Could not locate entry in sysdatabases for database 'select * from dbname'. No entry found with that name. Make sure that the name is entered correctly.thanksAshou" |
|
|
mr_mist
Grunnio
1870 Posts |
|
|
|
|
|